Home  >  Article  >  Backend Development  >  关于php显示指定目录下子目录的方法

关于php显示指定目录下子目录的方法

PHPz
PHPzforward
2016-05-16 20:19:592072browse

这篇文章主要介绍了php显示指定目录下子目录的方法,涉及php操作目录的技巧。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

关于php显示指定目录下子目录的方法

本文实例讲述了php显示指定目录下子目录的方法。分享给大家供大家参考。具体实现方法如下:

subdirs in dir
    "; $basedir = basename( __FILE__ ); $dirtoscan = ($basedir . '/somedir/'); $albumlisting = scandir($dirtoscan); foreach ($albumlisting as $item) { $dirinfo = pathinfo($item); print_r($dirinfo); if (is_dir("$item")) { echo "
  • $item
  • "; } } ?>

推荐学习:《PHP视频教程

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete