notes
notes copied to clipboard
PHP获取子目录列表 or PHP Get all subdirectories of a given directory
// 方法1
$dirsA = glob('/foo/path/*', GLOB_ONLYDIR);
// 方法2
$dirsB = array_filter(glob('/foo/path/*'), 'is_dir');
print_r( $dirsA);
print_r( $dirsB);