1. 首页
  2. 数据库
  3. 其它
  4. 统计PHP目录中的文件数方法

统计PHP目录中的文件数方法

上传者: 2021-02-01 11:37:24上传 PDF文件 41.76KB 热度 18次
代码示例如下: <?php $folderPath = upload/; $countFile = 0; $totalFiles = glob($folderPath . *); if ($totalFiles){ $countFile = count($totalFiles); } print_r($countFile); 相关函数介绍: glob()函数寻找与模式匹配的文件路径 glob ( string $pattern [, int $flags = 0 ] ) : array glob() 函数依照 libc glob() 函数使用的规则寻找所有与 pattern 匹配的
下载地址
用户评论