void sort
(array array);
This function sorts an array. Elements will be arranged from lowest to highest when this function has completed.
|
Example 1. sort() example
$fruits = array("lemon","orange","banana","apple");
sort($fruits);
for(reset($fruits);
$key = key($fruits);
next($fruits)) {
echo "fruits[$key] = ".$fruits[$key]."\n";
}
|
See also arsort() , asort() , ksort() , rsort() , and usort() .