Re: sorting results of opendir()
| From: | bleythbe at mailbox dot orst dot edu | Date: | Mon, 09 Jul 2001 19:13:02 +0000 |
| Subject: | Re: sorting results of opendir() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-57001@lists.php.net to get a copy of this message | ||
Just store each $file into an array ($array[] = $file)
and the sort($array). Works dandy =>
Ben
Quoting kmurrah <kmurrah@bakergrfx.com>:
> Greetings.
>
> I need to read the contents of a directory, sort
> it alphabetically, and
> display it ....
>
> i'm doing find on the reading and displaying,
> but can someone help me with
> the sort?
>
>
> $dir = opendir(".");
>
> while ($file=readdir($dir)) {
>
>
> if($file!= "." && $file != "..")
> {
> echo("$file<br>");
> }
> }
>
>
>
>
>
> thanks,
>
> kennm
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
>