multidimensional array sort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I have a multidimensional array that's built as follows (it's pretty much a directory tree):


Array (
 [Dir1] => Array (
     [User1] => Array (
         [0] => File1
         [1] => File2
     )
     [User2] => Array {
         [0] => File1
         [1] => File2
         [2] => File3
     }
 )
 [Dir2] => Array (
     [User1] => Array (
         [0] => File1
         [1] => File2
         [2] => File3
         [3] => File4
     )
     [User2] => Array {
         [0] => File1
     }
 )
)

   I need to do a sort on the whole thing in such a way that:
      a) all the Dir#'s are in ascending order, and
      b) all the User#'s are in ascending order with each Dir#, and
      b) all the File#'s are also in ascending order within each User#

I don't suppose there's an easy way to do this, other than doing it in several steps, is there? Is there even a way to JUST sort the Dir#'s (and the rest gets done at a later stage in the script)?

   -- A

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux