目录的递归操作

function webdir($dir

$handle=opendir($dir); 
echo 
"<br>目录: $dir<br>"
echo 
"档案:<br><ul>"
echo 
"<ul>"
while (
$file readdir($handle)) { 
if (
$file=="." || $file=="..") continue; 
if (
is_dir("$dir/$file")) 

echo 
"<目录> $file - $dir/$file<br>"
webdir("$dir/$file"); 
}else{ 
echo 
"<文件> $file<br>"


echo 
"</ul>"
closedir($handle); 


webdir("."); 

?>