PHP asort() functionThe asort( ) function is an inbuilt function of PHP. The asort( ) function is used to sort an associative array in ascending order, according to the value. This function was introduced in PHP 4.0. SyntaxParameters
ReturnIt returns true on success or false on failure. Example 1Output: Array ( [virat] => 29 [ganguly] => 39 [sachin] => 42 ) Example 2Output: Array ( [G] => Black [W] => Cyan [Y] => Green [B] => White [C] => Yellow ) Example 3Output: Array ( [compiler] => 68 [data structure] => 89 [OS] => 95 ) Example 4Output: Array ( [b] => Geography [d] => Hindi [c] => Math [a] => Science )
Next TopicPHP Array Functions
|