Two dimensional array sorting?
Posted: Fri Aug 12, 2005 8:37 am
Hello,
Well, I'm totally lost on sorting a 2-D array with string values. Here is the array named $filenames.
I want to sort the array, first, outer array - so keys must be arranged like [Acs], [Ascii], and [Hex].
Then, I want to sort the inner array of each outer array without changing its association with the key.
How can I do this? I've tried several functions listed in php.net, but nothing has worked so far.
I really appreciate your help.
Regards,
Well, I'm totally lost on sorting a 2-D array with string values. Here is the array named $filenames.
Array
(
[Ascii] => Array
(
[0] => ABC.htm
[1] => ACC.htm
)
[Hex] => Array
(
[0] => CAA.htm
[1] => AKA.htm
)
[Acs] => Array
(
[0] => CAA.htm
[1] => AKA.htm
)
I want to sort the array, first, outer array - so keys must be arranged like [Acs], [Ascii], and [Hex].
Then, I want to sort the inner array of each outer array without changing its association with the key.
How can I do this? I've tried several functions listed in php.net, but nothing has worked so far.
I really appreciate your help.
Regards,