File size: 1.02Kb
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta content="text/html; charset=Windows-1251" http-equiv="content-type">
<title>php</title>
</head><body>
<?php // Обьявление функции
function getFilesSize($path){
if ($bytes >= 2048)
{
$bytes = number_format($bytes / 2048, 2) . ' MB';
}
$fileSize = number_format($bytes / 2048, 2) . ' MB';
$dir = scandir($path);
foreach($dir as $file){
if (($file!='.') && ($file!='..'))
if(is_dir($path . '/' . $file))
$fileSize += getFilesSize($path.'/'.$file);
else
$fileSize += filesize($path . '/' . $file);
}
return $fileSize;
}
$myPath = "/home/u670935662/public_html/file_hosting/";
getFilesSize($myPath);
?>
<?php
echo getFilesSize($myPath);
?>
<br>
</body></html>