php array sort custom order code example
Example 1: sort multi array php
$keys = array_column($array, 'Price');
array_multisort($keys, SORT_ASC, $array);
print_r($array);
Example 2: php array sort
// Fonction de comparaison
function cmp($a, $b) {
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
}