This should be really simple, but what is the way to go on this. I want to sort an multidimensional array by a key, like this:
Array ( [0] => Array (
Try this
function cmp_by_status($a, $b) { if ($a['status'] == $b['status']) { return 0; } return ($a['status'] < $b['status') ? -1 : 1; } usort($data_array, "cmp_by_status");