如何在DESC顺序中排列内部数组键?以DESC顺序排列阵列
我可以按照DESB顺序排列11,12,其排列顺序为arsort()
,但内部数组保持不变。我试过array_multisort()
,usort()
等,但没有运气。
Array
(
[11] => Array
(
[4] => apr11timetable.php
[8] => aug11timetable.php
[6] => jun11timetable.php
[11] => nov11timetable.php
[10] => oct11timetable.php
)
[12] => Array
(
[4] => apr12timetable.php
[8] => aug12timetable.php
[2] => feb12timetable.php
[6] => jun12timetable.php
[10] => oct12timetable.php
)
)
感谢。另外,为什么'Arsort'不能正确排序你的数组?任何技术问题? – BentCoder
没有技术问题。您可以查看PHP Doc获取更多详细信息,并尝试@ air4x的代码片段(http://codepad.org/ne2ldv9w),以查看“arsort”的排序不正确。 – enenen
对不起,我没有看到你想按照DESC顺序排序。编辑我的答案。只需用'krsort'改变'ksort'。 – enenen