$arr = [ ['sort' => '2020-11-9'], ['sort' => '2020-11-10'], ['sort' => '2020-11-11'] ]; $r = collect($arr)->sortByDesc(function ($value) { return strtotime($value['sort']); })->values()->all(); dd($r);
laravel 排序
最新推荐文章于 2024-03-15 18:17:22 发布
$arr = [ ['sort' => '2020-11-9'], ['sort' => '2020-11-10'], ['sort' => '2020-11-11'] ]; $r = collect($arr)->sortByDesc(function ($value) { return strtotime($value['sort']); })->values()->all(); dd($r);