Re: natsort()
| From: | Richard Lynch | Date: | Fri, 27 Oct 2006 17:26:02 +0000 |
| Subject: | Re: natsort() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243758@lists.php.net to get a copy of this message | ||
On Thu, October 26, 2006 4:05 pm, Sandy wrote:
> <code>
> $d = '/somedir/subdir';
> $od = opendir($d);
> if ($od) {
> $dl = scandir($d);
> natsort($dl);
> }
> </code>
>
> The sorted array is available through print_r().
> How can I obtain a natsorted array that can be listed using :
>
> while ($i <= $array_count){print $dl[$i]}
foreach($dl as $i => $file){
echo "$i: $file<br />\n";
}
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?