View file 5555665/file_hosting/php.html

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 // &#1054;&#1073;&#1100;&#1103;&#1074;&#1083;&#1077;&#1085;&#1080;&#1077; &#1092;&#1091;&#1085;&#1082;&#1094;&#1080;&#1080;

   

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>