PHP uasort() functionThe PHP uasort( ) function is used to sort an array by its values using a user-defined comparison function. This function was introduced in PHP 4.0. SyntaxParameter
Return typeThe uasort( ) function returns true on success or false on failure. Example 1Output: Array ( [b] => badminton [d] => cricket [c] => football [a] => tennis ) Example 2Output: Array ( [2] => tata [4] => ford [1] => datsun [5] => audi ) Example 3Output: Array ( [d] => coconut [b] => banana [a] => apple ) Example 4Output: Array ( [f] => 4 [b] => 3 [a] => 2 [d] => 1 )
Next TopicPHP Array Functions
|