Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #13192

Re: readdir lists randomly

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!feedme.news.telefonica.de!telefonica.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: readdir lists randomly
Date Mon, 17 Mar 2014 12:05:20 +0100
Lines 34
Message-ID <5326D6F0.9000005@arnowelzel.de> (permalink)
References <11mnh75k6r3xo$.1mbw4jguuswxw$.dlg@40tude.net>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Trace individual.net 9UJ0QAYN8MTstxiHVe80lgWp+9UXGqDgXmka7dfzz+wQPWSl8t
Cancel-Lock sha1:xY+zrMV1dqw/qhl92/gxWU1OjLk=
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
In-Reply-To <11mnh75k6r3xo$.1mbw4jguuswxw$.dlg@40tude.net>
Xref csiph.com comp.lang.php:13192

Show key headers only | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

readdir lists randomly richard <noreply@example.com> - 2014-03-08 10:01 -0500
  Re: readdir lists randomly Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2014-03-08 10:15 -0500
    Re: readdir lists randomly Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2014-03-08 10:48 -0500
    Re: readdir lists randomly richard <noreply@example.com> - 2014-03-08 11:43 -0500
      Re: readdir lists randomly Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2014-03-08 11:58 -0500
        Re: readdir lists randomly richard <noreply@example.com> - 2014-03-08 13:05 -0500
  Re: readdir lists randomly Arno Welzel <usenet@arnowelzel.de> - 2014-03-17 12:05 +0100

csiph-web