I am using this peice of code:
$target = \'extracted/\' . $name[0];
$scan = scandir($target);
To scan the directory of a folder which is
The quick and dirty way:
$folders = glob("/*", GLOB_ONLYDIR);
A more versatile and object-oriented solution, inspired by earlier answers using DirectoryIterator but slightly more concise and general purpose:
$path = '';
$folders = [];
foreach (new \DirectoryIterator($path) as $file)
{
if (!$file->isDot() && $file->isDir())
{
$folders[] = $file;
}
}