Php uses the sort () function to sort arrays. Php uses the sort () function to sort arrays. This document describes how php uses the sort () function to sort arrays. Share it with you for your reference. The specific analysis is as follows: php uses the sort () function to sort arrays.
This example describes how php sorts arrays using the sort () function. Share it with you for your reference. The specific analysis is as follows:
The sort () function is used to sort arrays. this function assigns a new key name to the elements in the array. The original key name is deleted.
If the call succeeds, TRUE is returned. otherwise, FALSE is returned.
$ Alpha = array ("x", "a", "f", "c"); sort ($ alpha); foreach ($ alpha as $ var) {print "$ var
";}
Example 2
<? Php $ my_array = array ("a" => "Dog", "B" => "Cat", "c" => "Horse"); sort ($ my_array ); print_r ($ my_array);?>
Returned results
Array ([0] => Cat [1] => Dog [2] => Horse)
I hope this article will help you with php programming.
The sort () function sorts arrays. This article describes how php uses the sort () function to sort arrays. Share it with you for your reference. The specific analysis is as follows :...