Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does readdir() have a default order?

Status
Not open for further replies.

BlindPete

Programmer
Joined
Jul 5, 2000
Messages
711
Location
US
I am listing a directory, it appears that the files always come out from newest to oldest. Is this coincidence? an effect of the server or is it how readdir() works?

Code:
while (false !== ($file = readdir($handle)))

PHP.NET does not say either way.

-Pete
 
$##%#%#^^ thats embarrasing the site does say!

from:

Description
string readdir ( resource dir_handle )

Returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem.

-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top