获得这个文件夹中每个文件的大小,然后垒加!

解决方案 »

  1.   

    没有直接点的办法或者函数吗?
      

  2.   

    这个不知道,下面是一个查一个目录下多少文件的例子,
    你改改,像二楼说得那样加吧加吧吧
    <?
    $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('./hyforum_code/');
    echo "<br>请您注意脚本程序30秒钟超时警告<br><br>目录个数……………………$DirectoryCount<br>----文件个数……………………$FileCount<br>";
    ?>