我想按值位置(只能是 1 或 0)、日期和时间对多维数组进行排序。position = 1 的数组应该是第一个,并且它们应该按日期和时间排序。position = 0 的数组应该在 position = 1 的数组之后,并且还应该按日期和时间排序
Array
(
[001] => Array
(
[position] => 1
[Date] => 28.04.2013
[Time] => 00:21:38
)
[002] => Array
(
[position] => 1
[Date] => 28.04.2013
[Time] => 00:27:07
)
[003] => Array
(
[position] => 0
[Date] => 28.04.2013
[Time] => 00:15:06
)
[004] => Array
(
[position] => 0
[Date] => 28.04.2013
[Time] => 00:26:09
)
)
这就是我希望数组在排序后的样子:
Array
(
[002] => Array
(
[position] => 1
[Date] => 28.04.2013
[Time] => 00:27:07
)
[001] => Array
(
[position] => 1
[Date] => 28.04.2013
[Time] => 00:21:38
)
[004] => Array
(
[position] => 0
[Date] => 28.04.2013
[Time] => 00:26:09
)
[003] => Array
(
[position] => 0
[Date] => 28.04.2013
[Time] => 00:15:06
)
)
我尝试了一些功能,但没有一个能正常工作。position = 1 的数组是最后一个数组,或者所有数组都按日期和时间排序。我自己想不通。如果我的英语不好,请提前致谢。