gkloin
public php v1 · immutable<?function du($location) { if (!$location or !is_dir($location)) { return 0; } $total = 0; $all = opendir($location); while ($file = readdir($all)) { if (is_dir($location.'/'.$file) and $file <> ".." and $file <> ".") { $total += du($location.'/'.$file); unset($file); } elseif (!is_dir($location.'/'.$file)) { $stats = stat($location.'/'.$file); $total += $stats['size']; unset($file); } } closedir($all); unset($all); return $total;}print du('l');?>