try
<?
function dirsize($dir) {
// calculate the size of files in $dir, (it descends recursively into other dirs)
$dh = opendir($dir);
$size = 0;
while (($file = readdir($dh)) !== false)
if ($file != "." and $file != "..") {
$path = $dir."/".$file;
if (is_dir($path))
$size += dirsize($path);
elseif (is_file($path))
$size += filesize($path);
}
closedir($dh);
return $size;
}
echo number_format((dirsize("dir_name") / 1024), 2, '.', '');
?>
Cgraz