PHP readdir() not returning files in alphabetical order
- by Buggabill
I am reading through a directory with some pictures and such using a pretty simple implementation of readdir() like the following:
if ($handle = opendir($path)) {
while (false !== ($szFilename = readdir($handle))) {
if ($szFilename[0] !== '.') {
if (is_file($path.$szFilename)) {
// do stuff
}
}
…