I have this array
Array
(
[0] => Array
(
[brand] => blah blah
[location] => blah blah
[address] =>
This code helps to sort the multidimensional array using array_multisort()
$param_dt = array();
foreach ($data_set as $key => $row) {
if(isset($row['params']['priority']))
{
$param_dt[$key] = $row['params']['priority'];
}
else
{
$param_dt[$key] = -2; // if priority key is not set for this array - it first out
}
}
array_multisort($param_dt, SORT_ASC,SORT_NUMERIC, $data_set);
Now $data_set has the sorted list of elements.