PHP sort() functionThe PHP sort( ) function is used to sort the array elements in ascending order. This function was introduced in PHP 4.0. SyntaxParameter
ReturnsThe sort( ) function returns true on success or false on failure. Example 1Output: Array ( [0] => acoustic [1] => classical [2] => electric ) Example 2Output: Array ( [0] =>audi [1] =>bmw [2] =>nissan ) Example 3Output: Array ( [0] => 400 [1] => 100 [2] => 50 [3] => 20 [4] => 1 ) Array ( [0] => 1 [1] => 20 [2] => 50 [3] => 100 [4] => 400 ) Example 4Output: Array ( [0] => compiler [1] =>dbms [2] => networking [3] =>os )
Next TopicPHP Array Functions
|