Code: Select all
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
//echo "$file\n";
if (is_dir($file)) {
if ($file == 'gallery') {
$dirName = $file;
if (is_dir($dirName)) {
$handle = opendir($dirName);
while (false !== ($data = readdir($handle))) {
if ($data != '.' && $data != '..') {
if (is_dir($data)) {
echo $data . ' is a dir <br />';
}
else {
echo $data . ' is not a dir <br />';
}
}
}
}
}
//
}
}
}
}
closedir($handle);
/*
RESULTS
----------
beauty and portraits is not a dir
fashion is not a dir
fine art is not a dir
food is not a dir
love is not a dir
music is not a dir
places and faces is not a dir
*/
?>