Function sortByKey

Sorts given $array by key $sortBy.

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.

© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/function-sortByKey.html