我有數組$排行榜。其中包含以下數據如何按數組值排序多維數組。數組可能包含重複的值
Array
(
[0] => Array
(
[name] => ABC
[time_taken] => 01:46:56
)
[1] => Array
(
[name] => DEF
[time_taken] => 00:21:54
)
[2] => Array
(
[name] => MNO
[time_taken] => 00:34:14
)
[3] => Array
(
[name] => PQR
[time_taken] => 00:09:17
)
[4] => Array
(
[name] => XYZ
[time_taken] => 00:34:14
)
[5] => Array
(
[name] => STR
[time_taken] => 00:34:14
)
[6] => Array
(
[name] => LOK
[time_taken] => 17:53:58
)
}
我試着按時間對數組進行排序。它的工作正常,如果時間值不重複使用ksort。但是對於重複的時間,它只顯示在記錄中
直視[usort(HTTP ://www.php.net/manual/en/function.usort.php)或類似 – gwillie