Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Created July 31, 2016 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a1exlism/c303f545a119bfdd36018f86a8f9f6e3 to your computer and use it in GitHub Desktop.
Save a1exlism/c303f545a119bfdd36018f86a8f9f6e3 to your computer and use it in GitHub Desktop.
<?php
function listDir($dir)
{
if(is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
{
echo "<b><font color='red'>文件名:</font></b>",$file,"<br><hr>";
listDir($dir."/".$file."/");
}
else
{
if($file!="." && $file!="..")
{
echo $file."<br>";
}
}
}
closedir($dh);
}
}
}
listDir("./");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment