试试这样吧
function sortFunction( $a, $b ) { return strtotime($a[1]) - strtotime($b[1]); } usort($data, "sortFunction"); //Here You can use asort($data,"sortFunction")
或者你可以尝试细节(它的建议)
function sortFunction($a,$b) if ($a[1] == $b[1]) return 0; return strtotime($a[1]) - strtotime($b[1]); } usort($data,"sortFunction");
由于strtotime不服从d/m/Y格式尝试这样
$orderByDate = $my2 = array(); foreach($data as $key=>$row) { $my2 = explode('/',$row[1]); $my_date2 = $my2[1].'/'.$my2[0].'/'.$my2[2]; $orderByDate[$key] = strtotime($my_date2); } array_multisort($orderByDate, SORT_DESC, $data);