Close

PHP: Using scandir() to find folders in a directory

[code language=”php”]
$path = ‘extracted’; // ‘.’ for current
foreach (new DirectoryIterator($path) as $file)
{
if($file->isDot()) continue;

if($file->isDir()))
{
print $file->getFilename() . ‘<br />’;
}
}
[/code]