How to Sort Ascending an Array in PHP
In this lesson, we will see how to sort ascending an array in PHP, we will use the sort() function that sorts an indexed array in ascending order.
Sort ascending an array in PHP
The example below shows how you can sort ascending an array in PHP.
$notes = array( 12, 15, 4);
//sort array in ascending order
sort($notes);
print_r($notes);
//Array ( [0] => 4 [1] => 12 [2] => 15 )