Try this!
HalfaBee
<?php
$path = '.'; // current dir
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}
if( isdir( "$path/$file" ) )
$direxists = TRUE;
}
closedir($handle);
}
if( $direxists )
echo 'There is a sub-directory in the dir.';
?>