Re: sorting readdir output? [message #184020 is a reply to message #183997] |
Mon, 02 December 2013 18:54 |
Richard Yates
Messages: 86 Registered: September 2013
Karma:
|
Member |
|
|
On Sun, 1 Dec 2013 11:39:20 -0500, richard <noreply(at)example(dot)com>
wrote:
Isn't "false !==" unnecessary?
> <?php
>
> if ($handle = opendir('../audio/1960/')) {
> echo "Directory handle: $handle\n";
> echo "Entries:\n";
>
> /* This is the correct way to loop over the directory. */
> while (false !== ($entry = readdir($handle))) {
> echo "$entry\n<br>";
> }
>
> closedir($handle);
> }
> ?>
>
> This gives the output in an unsorted list.
> How can I make it so the array is sorted?
>
> http://us1.php.net/readdir
|
|
|