搜索文件夹下全部文件
//搜索文件夹下全部文件,暂时不支持中文文件名 public function scanFile($path) { if (!is_dir($path)) return array(); // 兼容各操作系统 $path = rtrim(str_replace('\\','/',$path ),'/').'/'; $result = array(); $files = scandir($path); foreach ($files as $file) { if ($file != '.' && $file != '..') { $file=iconv("gb2312","utf-8",$file); if (is_dir($path . '/' . $file)) { $result = array_merge($result, scanFile($path . '/' . $file)); } else { $result[] = basename($file); } } } return $result; }
相关推荐
-
Curl.php简单封装 get post php
2019-1-8
-
微信jssdk分享 php
2019-1-7
-
生成验证码 随机干扰php实现 php
2019-1-8
-
时间友好格式化风格 php
2019-1-8
-
php汉字转换成拼音的代码类 php
2019-1-8
-
将xml转为array 输出xml字符 php
2019-1-7
-
原生PHP生成 excl、word文件 php
2019-1-8
-
php生成各种验证码 php
2019-1-8
-
PHP数组 php
2019-1-7
-
用户密码存储方式 php
2019-1-7