Function sortByKey
Sorts given $array by key $sortBy.
Package: Cake
Link: https://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#sortByKey
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Located at Cake/basics.php
Link: https://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#sortByKey
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Located at Cake/basics.php
sortByKey( array $array , string $sortBy , string $order = 'asc' , integer $type = SORT_NUMERIC )
Parameters summary
array |
& $array |
$array Array to sort |
string |
$sortBy |
Sort by this key |
string |
$order = 'asc' |
Sort order asc/desc (ascending or descending). |
integer |
$type = SORT_NUMERIC |
Type of sorting to perform |
Returns
-
array|null
Sorted array, or null if not an array.