Advertisement
Guest User

Untitled

a guest
Jul 31st, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. function listDir($dir)
  3. {
  4. if(is_dir($dir))
  5. {
  6. if ($dh = opendir($dir))
  7. {
  8. while (($file = readdir($dh)) !== false)
  9. {
  10. if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
  11. {
  12. echo "<b><font color='red'>文件名:</font></b>",$file,"<br><hr>";
  13. listDir($dir."/".$file."/");
  14. }
  15. else
  16. {
  17. if($file!="." && $file!="..")
  18. {
  19. echo $file."<br>";
  20. }
  21. }
  22. }
  23. closedir($dh);
  24. }
  25. }
  26. }
  27. listDir("./");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement