这是一款从代码和速度上还不错的php目录遍历代码,有需要的朋友可以参考一下。
代码如下 复制代码
$path = '..';
function get_filetree($path){
$tree = array();
foreach(glob($path.'/*') as $single){
if(is_dir($single)){
$tree = array_merge($tree,get_filetree($single));
}
else{
$tree[] = $single;
}
}
return $tree;
}
print_r(get_filetree($path));
http://www.bkjia.com/phpjc/631704.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/631704.htmltecharticle这是一款从代码和速度上还不错的php目录遍历代码,有需要的朋友可以参考一下。 代码如下 复制代码 $path = '..'; function get_filetree($path){ $t...