RusLog.com
Вебмастерская => Вебпрограмминг/Скрипты => Тема начата: admin от 24 Апреля 2010, 19:04:08
-
<?
$dir = (".");
$f_size = 0;
size ($dir);
echo $f_size;
//---------------------------------------
function size ($dir)
{
global $f_size;
$dh = opendir ($dir);
while ($file = readdir($dh))
{
if($file!="." && $file!="..")
{
$fullpath = $dir."/".$file;
if(!is_dir ($fullpath))
{
$f_size = $f_size + filesize ($fullpath);
}
else
{
size ($fullpath);
}
}
}
closedir ($dh);
return ($f_size);
}
?>
украдено: http://tvoyweb.ru/forums/topic.php?forum=17&topic=248