function getdir_file($path = '.'){
$conndir = opendir($path);
while (($file = readdir($conndir))!==FALSE){
$sub_dir = $path . '/' .$file;
if($file == '.' || $file == '..'){
continue;
}else if(is_dir($sub_dir)){
echo 'Directory'.$file .'::';
getdir_file($sub_dir);
}else{
echo $file ."<br>";
}
}
closedir($conndir);
}
getdir_file('D:\wamp\www');
PHP 遍历循环目录
最新推荐文章于 2021-03-29 01:22:15 发布