Re: opendir(), readdir() question..
| From: | Catalin Trifu | Date: | Thu, 29 May 2003 19:03:56 +0000 |
| Subject: | Re: opendir(), readdir() question.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149472@lists.php.net to get a copy of this message | ||
Hi,
You could put them into an array and sort the array.
cheers,
Catalin
"<Ef>" <efernandez@tecsol.cl> wrote in message
news:20030529181343.20831.qmail@pb1.pair.com...
> Hi all,
>
> How can i do for the moment i open and list all file there, display in the
> browser the order of this files by name ?. I have this code:
>
> <?php
> $handle=opendir('.');
> while ($file = readdir($handle)) {
> if ($file != "." && $file != "..") {
> echo "$file\n";
> }
> }
> closedir($handle);
> ?>
>
> And the result send to the browser, is the files, but witouth any order.
>
> Thanks for reading, your help is greatly appreciated!
>
> --
> Esteban Fernández T.
>
>
>