readdir

From: Date: Fri, 15 Sep 2006 19:18:17 +0000
Subject: readdir
Groups: php.general 
Request: Send a blank email to php-general+get-241842@lists.php.net to get a copy of this message
I have been writing some code that visits each directory stored within one directory in turn, pics a random image from it and displays that image. I have the code working fine, apart from one small quirk that I can't really understand. In one version of the implementation, the directories appear to be getting accessed in the order they are uploaded to / edited on the server starting with the most recent upload/change - which is handy because it is what I wanted. But in another slightly different version of the same bit of code, it lists them in some weird order that I can't fathom. I suppose my question put simply is, what is the default ordering of directories when PHP uses the readdir method? And is there anyway to force a specific ordering to the directories before PHP searches down them? Any help would be greatly appreciated. Regards, Toby

« previous php.general (#241842) next »