<?
$d = dir(".");
echo "Handle: ".$d->handle."<br>\n";
echo "Path: ".$d->path."<br>\n";
while($entry=$d->read()) {
echo $entry."<br>\n";
}
$d->close();
?>
$d = dir(".");
echo "Handle: ".$d->handle."<br>\n";
echo "Path: ".$d->path."<br>\n";
while($entry=$d->read()) {
echo $entry."<br>\n";
}
$d->close();
?>
$FileCount = 0; //文件个数
$DirectoryCount = 0; //目录个数
function FCount($Path)
{
global $FileCount,$DirectoryCount;
$Handle = opendir($Path);
while($File = readdir($Handle))
{
if(filetype($Path.$File) != 'dir')
{
echo "----文件名----$File<br>";
$FileCount++;
}
if($File !='.' && $File !='..' && filetype($Path.$File)=='dir')
{
echo "目录名----$File<br>";
$DirectoryCount++;
FCount($Path."$File/");
}
}
closedir($Handle);
}
FCount('./upfiles/');
echo "<br>请您注意脚本程序30秒钟超时警告<br><br>目录个数……………………$DirectoryCount<br>----文件个数……………………$FileCount<br>";
?>
echo "$output";
//注: 反引号运算符在激活了 safe mode 或者关闭了 shell_exec() 时是无效的。