Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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("./");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement