is_dir()...does not recognise directory
Posted: Mon Dec 08, 2003 1:51 pm
Hello,
the following is a script that searches an 'images' directory for folders within it
My problem is it does not return the directories within the 'images' folder...and they are folders there.
however if i !is_dir() i do get it along with the image files as well.
What is wrong here.
Kendall
the following is a script that searches an 'images' directory for folders within it
Code: Select all
$dir = dir($path);
while (false !== ($content = $dir->read())){
// get files
if($TYPE == 'files'){
if($content != "." && $content != ".." && (($ext = strstr($content,$NOT)) != false)){
if(!is_dir($content)){
// get file stats
$date = filemtime($path.'/'.$content);
$CONTENTS[$date] = $content;
}
}
}
if($TYPE == 'folder'){
if(is_dir($content)){
echo 'debug folder function GET DIR - content - '.$content.'<br>';
$date = filemtime($path.'/'.$content);
$CONTENTS[$date] = $content;
}
}
}
$dir->close();
return $CONTENTS;however if i !is_dir() i do get it along with the image files as well.
What is wrong here.
Kendall