?php$dir = "."; //当前目录list_file($dir); function list_file($dir){ $list = scandir($dir); // scandir得到该文件下的所有文件和文件夹 foreach($list as $file){//遍历 $file_location=$dir."/".$file;//生成路径 if(is_dir(
<?php
$dir = "."; //当前目录
list_file($dir);
function list_file($dir){
$list = scandir($dir); // scandir得到该文件下的所有文件和文件夹
foreach($list as $file){//遍历
$file_location=$dir."/".$file;//生成路径
if(is_dir($file_location) && $file!="." &&$file!=".."){ //判断是不是文件夹
echo "------------------------sign in $file_location------------------<BR>";
list_file($file_location); //继续遍历
}
echo $dir."/".$file."<br/>";
}
}
?>
