0
我有值的数组如下:这个数组如何排序?
0-10
10-50
50-100
100-150
150-200
200+
这实际上是WordPress的分类法的阵列,其中WP排序字母(第一个数字的或升序),给我以下:
//notice how 50-100 gets pushed to the bottom, due to ascending order applied
0-10
10-50
100-150
150-200
200+
50-100
我只是想保持原始数组的秩序,因为这些是特定情况下的范围,最后50-100会干扰UI!
有谁知道一种方法来排序这个数组?
真棒! natsort做了这份工作!谢谢! –