Created
July 31, 2016 05:24
-
-
Save a1exlism/c303f545a119bfdd36018f86a8f9f6e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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