在唠叨老大的版面,我不合你一般见识。
贴出下面这段代码,纯粹是为了phper们借鉴之用,只为技术讨论。 $dh=opendir(AROOT."images/face");
while ($imagefile=readdir($dh)) {
if (($imagefile==".") || ($imagefile=="..") || ($imagefile=="")) continue;
$a++;
}
closedir($dh);
贴出下面这段代码,纯粹是为了phper们借鉴之用,只为技术讨论。 $dh=opendir(AROOT."images/face");
while ($imagefile=readdir($dh)) {
if (($imagefile==".") || ($imagefile=="..") || ($imagefile=="")) continue;
$a++;
}
closedir($dh);
解决方案 »
- 关于if语句是否有like的效果
- utf-8支持微软雅黑字体么?
- 我有个框架能不能使target="_blank"失效
- 求一个php文章采集类
- 大家好!今天我在安装window2003 中安装时遇到不能显示的问题?有谁能帮帮忙?谢谢
- [特急]关于php soap数据库错误导致客户端超时或500错误的问题
- PHP如何解析 WEBSERVICES接口返回的数据
- 大脑搞昏了...唉..问个循环的问题...偶只剩下十分了...下次补....
- 那里有支持php的比较好的免费主页
- 关于汉字显示的问题
- -----这样过滤后,SQL还注入的了么? (请注入高手指正) -----
- 高手指点,开发语言选择上举棋不定!
//统计目录下文件总数
function countFile($dir)
{
$count = 0;
$handle = opendir($dir);
while (false!==($FolderOrFile = readdir($handle)))
{
if($FolderOrFile != "." && $FolderOrFile != "..")
{
$count++;
}
}
closedir($handle);
return $count;
}
//使用实例
print countFile("./Discuz25");
//输出: 35
?>另外, 也要考虑是不是目录的情况. 如果只是想统计文件, 不想统计目录的话