How do you sort order for a column in which the value of two-dimensional array? $ Arr = [[ 'a' => 2], [ 'a' => 1], [ 'a' => 3]]
(1) uasourt function, the more flexible and can be sorted according to their wishes
uasourt($arr, function($p1, $p2) {
if ($p1['a'] == $p2['a']) return 0;
return $p1['a'] > $p2['a'] ? 1 : -1;
})
(2) array_multisort This function will sort the first array, the second array element position of the first array followed by transformation with
foreach($arr as $k => $v)
$sort[$k] = $v['a'];
array_multisort($sort, $arr);