Articles → PHP → Sort() Method In PHP
Sort() Method In PHP
Purpose
Example
$numbers=array(4,6,2,22,11);
echo "Array before sort:";
print_r($numbers);
echo "<br/>";
// Sorting an array
sort($numbers);
echo "Array after sort:";
print_r($numbers);
Output
Click to Enlarge