php之遍历文件夹目录


<?php
	
function dirList($dir){
	$arr = scandir($dir);
	foreach ($arr as $v) {
		if($v != "." && $v != ".."){
			$path = $dir."/".$v;
			if(is_dir($path)){
				dirList($path);
			}else{
				echo "<p>$path</p>";
			}
		}
	}
}

dirList('./');

猜你喜欢

转载自blog.csdn.net/qq_16059847/article/details/82499003