FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » readdir lists randomly
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: readdir lists randomly [message #185303 is a reply to message #185199] Mon, 17 March 2014 11:05 Go to previous message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma:
Senior Member
Am 08.03.2014 16:01, schrieb richard:

> From the php manual
>
>
> 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";
> echo "<br>";
>
> }
>
> closedir($handle);
> }
>
> Is there a way to list the entries according to the order they are listed
> in the directory?
> such as
> 60-001
> 60-002
> 60-003

A directory does not have such "order". The sorting has to be done
afterwards.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [CM] Falkvinge: MtGox had custom SSHD written in PHP
Next Topic: Filling an array with random input doesn't quite work
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 01:41:09 GMT 2024

Total time taken to generate the page: 0.04438 seconds