<?php
/* Directory data calculation in MB */
function folderSize ($dir)
{
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : folderSize($each);
}
return $size;
}
?>
<?php
$newsDIR = folderSize("/home/apnaaagaz00/public_html/media");
echo round(($newsDIR/1024/1024)).' Mb';
?>
No comments:
Post a Comment