|
Posted by christiang on 02/07/06 01:47
Hi guys I'd like to sort a multidimensional array that hasn't numerical
index, in fact it is like:
Array
(
[mobile] => Array
(
[name_str] => mobile
[relationCount_int] => 1
)
[video] => Array
(
[name_str] => video
[relationCount_int] => 2
)
[flash] => Array
(
[name_str] => flash
[relationCount_int] => 1
)
[tool] => Array
(
[name_str] => tool
[relationCount_int] => 1
)
)
And I'd like to sort, for instance for the value of
"relationCount_int", so the new order should be something like:
Array
(
[video] => Array
(
[name_str] => video
[relationCount_int] => 2
)
[mobile] => Array
(
[name_str] => mobile
[relationCount_int] => 1
)
[flash] => Array
(
[name_str] => flash
[relationCount_int] => 1
)
[tool] => Array
(
[name_str] => tool
[relationCount_int] => 1
)
)
Any idea? I tried some script I found on php.net but didn't work. The
could should run inside a class method.
Thanks a lot, chr
Navigation:
[Reply to this message]
|