PHP来计算某个目录大小的方法。
PHP CURL session COOKIE 
可以调用系统命令,还可以这样: 
<?php
function dirsize($dir) { 
@$dh = opendir($dir); 
$size = 0; 
while ($file = @readdir($dh)) { 
if ($file != "." and $file != "..") { 
$path = $dir."/".$file
if (is_dir($path)) { 
$size += dirsize($path); 
elseif (is_file($path)) { 
$size += filesize($path); 
} // www.jbxue.com


@closedir($dh); 
return $size


$bb = "/var/www/lg"; 
$cc = dirsize("$bb"); 
$aa = $cc/1024/1024; 
echo $aa.MB." 
"." 
"; 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-22
  • 2021-12-24
  • 2021-08-14
  • 2022-12-23
  • 2022-01-22
相关资源
相似解决方案