Hi guys I'd like to sort a multidimensiona l array that hasn't numerical
index, in fact it is like:
Array
(
[mobile] => Array
(
[name_str] => mobile
[relationCount_i nt] => 1
)
[video] => Array
(
[name_str] => video
[relationCount_i nt] => 2
)
[flash] => Array
(
[name_str] => flash
[relationCount_i nt] => 1
)
[tool] => Array
(
[name_str] => tool
[relationCount_i nt] => 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_i nt] => 2
)
[mobile] => Array
(
[name_str] => mobile
[relationCount_i nt] => 1
)
[flash] => Array
(
[name_str] => flash
[relationCount_i nt] => 1
)
[tool] => Array
(
[name_str] => tool
[relationCount_i nt] => 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
index, in fact it is like:
Array
(
[mobile] => Array
(
[name_str] => mobile
[relationCount_i nt] => 1
)
[video] => Array
(
[name_str] => video
[relationCount_i nt] => 2
)
[flash] => Array
(
[name_str] => flash
[relationCount_i nt] => 1
)
[tool] => Array
(
[name_str] => tool
[relationCount_i nt] => 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_i nt] => 2
)
[mobile] => Array
(
[name_str] => mobile
[relationCount_i nt] => 1
)
[flash] => Array
(
[name_str] => flash
[relationCount_i nt] => 1
)
[tool] => Array
(
[name_str] => tool
[relationCount_i nt] => 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
Comment