我有一个像这样的PHP数组:
Array
(
[0] => post9.post
[3] => post8.post
[4] => post4.post
[5] => post7.post
[6] => post5.post
[7] => post10.post
[8] => post3.post
[9] => post6.post
[10] => post1.post
[11] => post2.post
)
但是在尝试了所有PHP数组函数后,我无法以这种方式对它进行排序:
Array
(
[0] => post10.post
[1] => post9.post
[2] => post8.post
[3] => post7.post
[4] => post6.post
[5] => post5.post
[6] => post4.post
[7] => post3.post
[8] => post2.post
[9] => post1.post
)
我已经提出了这样的问题,这似乎有效,但现在它不起作用:(
编辑:使用rsort
后,它看起来像这样:
Array
(
[0] => post9.post
[1] => post8.post
[2] => post7.post
[3] => post6.post
[4] => post5.post
[5] => post4.post
[6] => post3.post
[7] => post2.post
[8] => post10.post
[9] => post1.post
)
几乎不错,除了post10.post应为[0]
且[8]