版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wtfsb/article/details/78340755
<?php
function showdir($path)
{
if (is_dir($path)){
if ($dh = opendir($path)){
while (($file = readdir($dh)) !== false){
if($file=="."||$file=="..")
{
continue;
}
echo "filename:" . $file . "<br>";
if(is_dir($path.'/'.$file))
{
showdir($path.'/'.$file);
}
}
closedir($dh);
}
}
}
showdir(".");