function getfiles($path) {
$handle = opendir($path);
while(($file=readdir($handle)) !==false) {
if($file !='.' && $file !='..') {
$path2= $path.'/'.$file;
if(is_dir($path2)) {
echo $file;
echo "<br/>";
getfiles($path2);
}else {
echo $file;
echo "<br/>";
}
}
}
}
面试可能需要,备之