使用php获取目录中的文件文件夹文件计数文件夹计数
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用php获取目录中的文件文件夹文件计数文件夹计数相关的知识,希望对你有一定的参考价值。
Getting files, folders, file count, folder count in a directory with php and writing them to a web page
<?php $folderCount = $fileCount = 0; //. means current directory //if you wanna a learn a folders inside use opendir('path') if ($entry != "." && $entry != "..") { echo "Folder => " . $entry . "<br>"; $folderCount++; } else { echo "File => " . $entry . "<br>"; $fileCount++; } } } echo "<br>==============<br>"; echo "Total Folder Count : " . $folderCount . "<br>"; echo "Total File Count : " . $fileCount; } ?>
以上是关于使用php获取目录中的文件文件夹文件计数文件夹计数的主要内容,如果未能解决你的问题,请参考以下文章