Online Shopping : Computers : Programming : Languages : PHP : Function Libraries : File Handling

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 16 people (75%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Are the results of readdir() sorted?

Jan 25th, 2000 22:04
Nathan Wallace, Torben Wilson, David Coulson


It'll just return the order they are stored in the directories file
list, which is _usually_ oldest first, although it depends upon the
filesystem your using. I personally wouldn't rely on them coming out in
any sort of order.

PHP returns the entries in whatever order the system C library readdir()
returns them. PHP imposes no order of its own on the sort order.

Here is the manual entry:

    http://www.php.net/manual/function.readdir.php3