sorting an array php 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
function aasort (&$array, $key) {
$sorter=array();
$ret=array();
reset($array);
foreach ($array as $ii => $va) {
$sorter[$ii]=$va[$key];
}
asort($sorter);
foreach ($sorter as $ii => $va) {
$ret[$ii]=$array[$ii];
}
$array=$ret;
}
aasort($your_array,"order");