Good day to you all,
is there a way to check if a specific folder contains: files, folder, both or none ?
I read my folder with Glob, like my code here :
[code=php]
<?PHP
function globDir($dir)
{
$files = glob(“$dir/*”, GLOB_ONLYDIR);
if(!empty($files))
{
echo “<ul>n”;
foreach($files as $file)
{
echo “<li><b>”. basename($file).”</b>n”;
globDir($file);
echo “</li>n”;
}
echo “</ul>n”;
}
}
globDir(‘Photos’);
?>
The only thing I have really found is how to find if a specific file exists.
I’m trying to find out if a specific folder contains : files, folders, both, none.
It would return the appropriate word accordingly.
Thanks and take care!