php遍历路径文件
来源:互联网 发布:农村淘宝的现状分析 编辑:程序博客网 时间:2024/06/06 01:46
1.代码来自php官方文档
function scanDirectories($rootDir, $allData=array()) { // set filenames invisible if you want $invisibleFileNames = array(".", "..", ".htaccess", ".htpasswd"); // run through content of root directory $dirContent = scandir($rootDir); foreach($dirContent as $key => $content) { // filter all files not accessible $path = $rootDir.'/'.$content; if(!in_array($content, $invisibleFileNames)) { // if content is file & readable, add to array if(is_file($path) && is_readable($path)) { // save file name with path $allData[] = $path; // if content is a directory and readable, add path and name }elseif(is_dir($path) && is_readable($path)) { // recursive callback to open new directory $allData = scanDirectories($path, $allData); } } } return $allData;}var_dump(scanDirectories('D:\www')) ;
阅读全文
0 0
- php遍历路径文件
- php遍历文件夹下面的所有文件,得到文件路径
- 002.PHP遍历路径
- php遍历指定路径下的所有文件和文件夹
- php遍历文件
- php ---- 文件遍历
- php 遍历 excel文件。
- php 遍历txt文件
- php遍历文件目录
- php遍历文件夹、文件
- iOS 文件路径深度遍历
- php文件路径信息
- PHP文件上传路径
- php包含文件路径
- PHP文件路径
- php-文件路径问题
- PHP文件路径解析
- php 遍历文件夹及文件,获取文件名和文件路径存入数据库中
- oracle创建自增字段
- Material Design之CollapsingToolbarLayout使用(折叠式标题栏)
- 多人部件解析--Towards Real World Human Parsing: Multiple-Human Parsing in the Wild
- PHP命名空间详解。
- 最大子序列和详解
- php遍历路径文件
- 【官方解说】Visual Studio 2017(VS 2017)各个版本有什么区别
- 文章标题
- Java 习题4 答案及解析
- PhP功能模块扩展——ImageMagick
- C++ Primer Plus(第六版)—— 第四章 复合类型 笔记和答案
- RR报文解析(二) fraction lost
- Material Design之TabLayout的用法(标题栏滑动+ViewPager)
- Win2008系统创建WEB服务器