PHP arsort() ফাংশন
উদাহরণ
অ্যাসোসিয়েটেড অ্যারের কী-মান অনুযায়ী পদ্ধতিগত ক্রমবিন্যাস করুন:
<?php $age=array("Bill"=>"60","Steve"=>"56","Mark"=>"31"); arsort($age); ?>
সংজ্ঞা ও ব্যবহার
arsort() ফাংশন অ্যাসোসিয়েটেড অ্যারের কী-মান অনুযায়ী পদ্ধতিগত ক্রমবিন্যাস করে।
Hint:Please use asort() The function sorts the associated array in ascending order by key value.
Hint:Please use krsort() The function sorts the associated array in descending order by key name.
Syntax
arsort(array,sortingtype);
Parameters | Description |
---|---|
array | Required. Specifies the array to be sorted. |
sortingtype |
Optional. Specifies how to sort the elements/items of the array. Possible values:
|
Description
The arsort() function sorts an array in reverse order while maintaining the index relationship. It is mainly used to sort combined arrays where the order of units is very important.
The optional second parameter includes additional sorting identifiers.
Returns TRUE if successful, otherwise FALSE.
Technical Details
Return Value: | Returns TRUE if successful, otherwise FALSE. |
PHP Version: | 4+ |