如何对其创建的列表进行排序? 这是我的结果:
array (size=10)
1 => int 0
2 => int 2
3 => int 3
4 => int 2
5 => int 2
6 => int 1
7 => int 0
8 => int 2
9 => int 1
10 => int 2
虽然这是我想要的:
array (size=10)
3 => int 3
2 => int 2
4 => int 2
5 => int 2
8 => int 2
10 => int 2
6 => int 1
9 => int 1
1 => int 0
7 => int 0
答案 0 :(得分:0)
你应该看看php数组排序函数,你可能需要这样的东西...
$array = arsort($array);