notes icon indicating copy to clipboard operation
notes copied to clipboard

PHP获取子目录列表 or PHP Get all subdirectories of a given directory

Open lanlin opened this issue 6 years ago • 0 comments

// 方法1
$dirsA = glob('/foo/path/*', GLOB_ONLYDIR);

// 方法2
$dirsB = array_filter(glob('/foo/path/*'), 'is_dir');

print_r( $dirsA);
print_r( $dirsB);

lanlin avatar Feb 25 '19 06:02 lanlin