嗨我必須在desc中排序這個數組。以ratingVal爲基礎使用php命令。我怎樣才能做到這一點。如何使用php對多維數組進行排序?
Array
(
[0] => Array
(
[rating_postid] => 26
[raCnt] => 6
[sRate] => 18
[ratingVal] => 3
)
[1] => Array
(
[rating_postid] => 714
[raCnt] => 3
[sRate] => 14
[ratingVal] => 4.6666666666667
)
[2] => Array
(
[rating_postid] => 14
[raCnt] => 4
[sRate] => 12
[ratingVal] => 3
)
[3] => Array
(
[rating_postid] => 290
[raCnt] => 2
[sRate] => 10
[ratingVal] => 5
)
[4] => Array
(
[rating_postid] => 194
[raCnt] => 2
[sRate] => 8
[ratingVal] => 4
)
[5] => Array
(
[rating_postid] => 134
[raCnt] => 2
[sRate] => 6
[ratingVal] => 3
)
[6] => Array
(
[rating_postid] => 707
[raCnt] => 1
[sRate] => 5
[ratingVal] => 5
)
)
我重申了您的問題以使用更合適的標籤, G。如果你真的使用5.2.X,不要使用PHP 5.3標籤。 – Max 2010-10-27 10:56:10