php显示当前文件所在的文件以及文件夹所有文件,树形展开

浏览:
字体:
发布时间:2013-12-17 09:37:29
来源:
  1. $path = "./";
  2. function createDir($path = '.')
  3. {
  4. if ($handle = opendir($path))
  5. {
  6. echo "
      ";
    • while (false !== ($file = readdir($handle)))
    • {
    • if (is_dir($path.$file) && $file != '.' && $file !='..')
    • printSubDir($file, $path, $queue);
    • else if ($file != '.' && $file !='..')
    • $queue[] = $file;
    • }
    • printQueue($queue, $path);
    • echo "
    ";
  7. }
  8. }
  9. function printQueue($queue, $path)
  10. {
  11. foreach ($queue as $file)
  12. {
  13. printFile($file, $path);
  14. }
  15. }
  16. function printFile($file, $path)
  17. {
  18. echo "
  19. $file
  20. ";
  21. }
  22. function printSubDir($dir, $path)
  23. {
  24. echo "
  25. $dir";
  26. createDir($path.$dir."/");
  27. echo "
  28. ";
  29. }
  30. createDir($path);
  31. ?>


原文地址:http://www.freejs.net/article_jquerywenzi_112.html
>更多相关文章
首页推荐
相关文章
24小时热门资讯
24小时回复排行
热门推荐
最新资讯
网络安全
操作系统
黑客防御
站长知识
资讯 | QQ | 安全 | 编程 | 数据库 | 系统 | 网络 | 考试 | 站长 | 关于东联 | 安全雇佣 | 搞笑视频大全 | 微信学院 | 视频课程 |
关于我们 | 联系我们 | 广告服务 | 免责申明 | 作品发布 | 网站地图 | 官方微博 | 技术培训
Copyright © 2007 - 2024 Vm888.Com. All Rights Reserved
粤公网安备 44060402001498号 粤ICP备19097316号 请遵循相关法律法规
');})();