4
我有一個陣列這樣
陣列[0] [0],[1] [0],[2] [0]是問題,並在數組[0] [1],[1] [1],[2] [1]是對這些問題的答案。
現在我想對這個數組的數量進行排序。
第一個問題只有一個答案和 第二個有兩個答案和第三個有三個答案。
對於該問題的答案數,排序後的數組應該按降序排列。 是否有無法在sql中實現這一點?或者我們如何在PHP中排序?希望我的問題很明確。先謝謝你。
Array
(
[0] => Array
(
[0] => Array
(
[0] => 12
[1] => 110
[2] => Tom
[3] => [email protected]
[4] => Hello tom how are you?
[5] => 2013-01-03 14:54:07
)
[1] => Array
(
[0] => Array
(
[0] => 12
[1] => Yes i am fine.
[2] => Arun
[3] => [email protected]
[4] => 2013-01-03 14:55:22
)
)
)
[1] => Array
(
[0] => Array
(
[0] => 12
[1] => 110
[2] => Tom
[3] => [email protected]
[4] => Hello tom how are you.
[5] => 2013-01-03 14:54:07
)
[1] => Array
(
[0] => Array
(
[0] => 12
[1] => Yes i am fine
[2] => Arun
[3] => [email protected]
[4] => 2013-01-03 14:55:22
)
[1] => Array
(
[0] => 12
[1] => Yes i am fine
[2] => Arun
[3] => [email protected]
[4] => 2013-01-03 14:55:22
)
)
)
[2] => Array
(
[0] => Array
(
[0] => 12
[1] => 110
[2] => Tom
[3] => [email protected]
[4] => Hello tom how are you.
[5] => 2013-01-03 14:54:07
)
[1] => Array
(
[0] => Array
(
[0] => 12
[1] => Yes i am fine
[2] => Arun
[3] => [email protected]
[4] => 2013-01-03 14:55:22
)
[1] => Array
(
[0] => 12
[1] => Yes i am fine
[2] => Arun
[3] => [email protected]
[4] => 2013-01-03 14:55:22
)
[2] => Array
(
[0] => 12
[1] => Yes i am fine
[2] => Arun
[3] => [email protected]
[4] => 2013-01-03 14:55:22
)
)
)
究竟是什麼,你是想用這個做什麼? – 2013-01-04 05:54:12
按降序對問題進行排序,以便首先顯示具有最多答案的用戶。你是否清楚我的問題? –
當您將數據導出到SO時,最好使用'var_export',這樣人們可以將您提供的數據複製到測試中。 – Supericy