PHP krsort() 函数
定义和用法
krsort() 函数对关联数组按照键名进行降序排序。
Tip:Please use ksort() The function sorts the associated array in ascending order by key name.
Tip:Please use arsort() The function sorts the associated array in descending order by key value.
Syntax
krsort(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 krsort() function sorts an array in reverse order by key, retaining the original keys of the array values.
The optional second parameter includes additional sorting flags.
Returns TRUE if successful, otherwise returns FALSE.
Technical Details
Return Value: | Returns TRUE if successful, otherwise returns FALSE. |
PHP Version: | 4+ |