Re: array_multisort into Natural order?

From: Date: Mon, 13 Dec 2010 23:00:46 +0000
Subject: Re: array_multisort into Natural order?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-310007@lists.php.net to get a copy of this message
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 > > >

« previous php.general (#310007) next »