1
數組
嗯,我有一個PHP數組是這樣的:問題訂貨時在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
之後,它看起來像THI S:
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]
唉,這使得伎倆:)謝謝! – pmerino
最後,在6個不正確的答案中實際的正確答案。 –
+1比我想出的更好:) – AlienWebguy