$allItem = [ ["id"=>10,"updated_at"=>"2018-11-01"], ["id"=>88,"updated_at"=>"2018-10-05"], ["id"=>33,"updated_at"=>"2018-10-25"], ]; array_multisort(array_column($allItem, 'updated_at'), SORT_DESC, $allItem); print_r($allItem);
$allItem = [ ["id"=>10,"updated_at"=>"2018-11-01"], ["id"=>88,"updated_at"=>"2018-10-05"], ["id"=>33,"updated_at"=>"2018-10-25"], ]; array_multisort(array_column($allItem, 'updated_at'), SORT_DESC, $allItem); print_r($allItem);
转载于:https://www.cnblogs.com/zhaoyang-1989/p/9890742.html