2, 'id'=>1], ['weight'=>2, 'id'=>2], ]; usort($match, function ($v1, $v2) { if ($v2['weight'] > $v1['weight']) { return true; } if ($v2['id'] > $v1['id']) { return true; } return false; }); var_dump($match); } }