PHP sort multidimensional array by date

后端 未结 4 1468
遇见更好的自我
遇见更好的自我 2021-01-18 16:58

I\'m having a problem. I have a multidimensional array, that looks like this:

Array ( [0] => 
              Array ( 
                    [0] => Testguy         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-18 17:44

    $dates = array();       
    foreach($a AS $val){
        $dates[] = strtotime($val[2]);
    }
    array_multisort($dates, SORT_ASC, $a);
    

提交回复
热议问题