/ Published in: PHP
Calculate dir size recursive, follow the link above because the version above is better.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function dirsize($dir,$buf=2) { static $buffer; $size=0; if($file=='.' || $file=='..') continue; $size+=dirsize($dir.'/'.$file,$buf-1); } if($buf>0) $buffer[$dir]=$size; return $size; } return false; }
URL: http://www.barattalo.it/2010/02/01/calculate-dir-size-recursively/