PHP uksort() functionThe PHP uksort( ) function is used to sort an array by the elements keys using a user-defined comparison function. This function was introduced in PHP 4.0. SyntaxParameter
Return typeThe uksort( ) function returns true on success or false on failure. Example 1Output: Array ( [d] => mango [b] => banana [a] => apple ) Example 2Output: Array ( [6] => python [4] => ruby [2] => php [1] => java ) Example 3Output: Array ( [a] => 9 [b] => 2 [c] => 60 [d] => 78 ) Example 4Output: Array ( [8] => football [4] => badminton [2] => hockey [1] => cricket )
Next TopicPHP Array Functions
|