Source Code:
(back to article)
<?php $array = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3]; function compare($a, $b) { return $a < $b ? -1 : 1; } uasort($array, "compare"); print_r($array);
Result:
Report an issue