Posted by mjstenberg on 03/05/07 15:55
Im using a batch process function but found PHP to behave very
strangely: It only reads subdirs that have caharacters in their names.
Im having subdirs with integer names (0, 1, 2, 3.. ) but this script
does not read them at all?! Can someone tell me how to get around
this?
function readSubdir($dirPath) {
chdir($dirPath);
$dirPointer = opendir(".");
while (($file = readdir($dirPointer)) != false) {
if ($file == "." || $file == "..")
continue; // skip current and upper
directories
if (filetype($file) == "dir") {
echo $file ."\n";
readSubdir($file);
} else {
// echo "file is $file\n";
} // else
} // while
closedir($dirPointer);
chdir("..");
}
Thanks
[Back to original message]
|