natsort()
| From: | Sandy | Date: | Thu, 26 Oct 2006 21:05:07 +0000 |
| Subject: | natsort() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-243708@lists.php.net to get a copy of this message | ||
Hi
php5
<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]}
Thanks