I'm trying to order this multidimensional array, with no success. I need to sort ascending by pub_obs
but keeping the main array order (AC, BA, ..). The indexes inside the main arrays (0, 1, 2, ..) can change but the pub_id
have to be the same.
Array(
[AC] => Array
(
[0] => Array
(
[pub_id] => 1
[pub_obs] => c
)
[1] => Array
(
[pub_id] => 3
[pub_obs] => a
)
[2] => Array
(
[pub_id] => 4
[pub_obs] => c
)
)
[BA] => Array
(
[0] => Array
(
[pub_id] => 1
[pub_obs] => b
)
[1] => Array
(
[pub_id] => 2
[pub_obs] => b
)
[2] => Array
(
[pub_id] => 7
[pub_obs] => a
)
)
)
Somebody can help? Thanks!
Edit
I forgot to say about the PHP version, 5.2, but @fusion3k was quick! thanks for the answer dude and for everybody who helped too!