function scandir_folders($d) { return array_filter(scandir($d), function ($f) use($d) { return is_dir($d . DIRECTORY_SEPARATOR . $f); }); } ?>