用PHP如何获取linux系统一个目录下文件的数目?

我翻了一下PHP手册,没找到相关的函数,但我想一定能实现这个功能的,哪位高手知道啊?请告诉我一下好吗?谢谢!
---------------------------------------------------------------

 1   
 2$files = 0;   
 3if ($handle = opendir('.')) {   
 4while (false !== ($file = readdir($handle))) {   
 5if (is_file($file)) {   
 6$files++;   
 7}   
 8}   
 9closedir($handle);   
10}   
11echo $files;   
Published At
Categories with Web编程
Tagged with
comments powered by Disqus