+ -
当前位置:首页 → 问答吧 → 遍历一个文件夹下的文件及子文件夹中的文件

遍历一个文件夹下的文件及子文件夹中的文件

时间:2008-11-05

来源:互联网



<?
function show_list($path){
    if(is_dir($path)){
        $dp=dir($path);
        while($file=$dp->read())
            if($file!='.'&&$file!='..')
                show_list($path.'/'.$file);
        $dp->close();
    }
    echo "$path<br>";
}
show_list('test');
?>



作者: jun708   发布时间: 2008-11-05

挺强的!

作者: burt   发布时间: 2009-02-16

支持下吧。。

作者: 背包客   发布时间: 2009-12-21