Quicksort is one of the best storting algorithms.
Here is how you do it through PHP
function quicksort($array) {
// Base case: an array with 0 or 1 elements is already sorted
$length = count($array);
if ($length <= 1) {
return $array;
}
// Choose a pivot element...