I just checked if there was a function availible and it is: filesize(); so I designed this script for you!
The online thing you have to do is changing the $dir to the path (local path no http address) to your path.. Please don't forget to add the slash on the end:
/Users/kasper/Sites/www/
in stead of:
/Users/kasper/Sites/www
<?php
$dir = "/Users/kasper/Sites/www/";
$handle=opendir($dir);
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$filename = $dir . $file;
$size = filesize($filename) + $size;
}
}
closedir($handle);
//Making kb's from bytes
$kbsize = $size / 1024;
$kbsize = round($kbsize);
//Making MB's from kb's;
$mbsize = $kbsize / 1024;
$mbsize = round($mbsize);
//Making Output
print "Size in Bytes: " . $size . " Bytes <BR>";
print "Size in KiloBytes: " . $kbsize . " kb <BR>";
print "Size in MegaBytes: " . $mbsize . " MB <BR>";
?>
Gr.
kasper