Re: array_multisort into Natural order?

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

 



On 12/13/2010 11:59 AM, George Langley wrote:
> Hi all. Can use natsort($array1) to sort a single array of filenames into a "natural "alphanumeric order - 1.php, 2.php, 5.php, 10.php, 20.php, etc.
> But using array_multisort($array1, $array2, $array3) doesn't offer a natsort option, so I end up with 1.php, 10.php, 2.php, 20.php, 5.php, etc.
> 
> Anyone have a solution to this limitation already? Nothing found in the archives or Googling.
> 	Thanks.

assuming that you are not using other options of array_multisort(), why not do
something like this.

$ar = array_merge($array1, $array2, $array3);
natsort($ar);

> 
> 
> George Langley    Multimedia Developer    Audio/Video Editor    Musician, Arranger, Composer www.georgelangley.ca
> 
> 
> 



-- 
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