Write something to recurse through the files and add together all their sizes.
function scanDir($dirPath) {
global $totalSize;
$my_dir = openDir($dirPath);
while ($my_file = readDir($my_dir)) {
if ($my_file != "."and $my_file != "..") {
if (is_dir($dirPath."/".$my_file)) {
scanDir($dirPath."/".$my_file);
} else {
$totalSize += filesize($dirPath."/".$my_file);
}
}
}
}
To use it:
$totalSize = 0;
scanDir("myDir");
As ever, I haven't tested this..