<?php
function traverseDir($dir){
if($dir_handle = @opendir($dir)){
while($filename = readdir($dir_handle)){
if($filename != "." && $filename != ".."){
$subFile = $dir.DIRECTORY_SEPARATOR.$filename; //è¦å°æºç®å½ååæ件ç¸è¿
if(is_dir($subFile)){ //è¥åæ件æ¯ä¸ªç®å½
echo $filename.'<br>'; //è¾åºè¯¥ç®å½å称
traverseDir($subFile); //éå½æ¾åºä¸çº§ç®å½å称
}
}
}
closedir($dir_handle);
}
}
$dirNames = traverseDir("d:/dos"); //æµè¯æç®å½
?>
追é®è°¢è°¢