对这个多维数组进行排序的最快方法?
按国家/地区字母顺序和日期数字顺序排序的最快方法是什么?:
Array
(
[JAPAN] => Array
(
[2010-10-17] => 2
)
[CUBA] => Array
(
[2010-10-16] => 9
)
[RUSSIAN FEDERATION] => Array
(
[2010-10-16] => 26
[2010-10-17] => 6
[2010-10-18] => 2
)
[CHINA] => Array
(
[2010-10-16] => 13
)
)
What is the fastest way of sorting this both alphabetically by country and numerically by date?:
Array
(
[JAPAN] => Array
(
[2010-10-17] => 2
)
[CUBA] => Array
(
[2010-10-16] => 9
)
[RUSSIAN FEDERATION] => Array
(
[2010-10-16] => 26
[2010-10-17] => 6
[2010-10-18] => 2
)
[CHINA] => Array
(
[2010-10-16] => 13
)
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://codepad.org/wJn0hJN4
http://codepad.org/wJn0hJN4
您将必须对更多数据进行基准测试。我会尝试 ksort 按国家/地区和 usort 用于按日期排序。
You will have to benchmark on more data. I'd try ksort for sorting by countries and usort for sorting by dates.