/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Calculate directory size. * @param string $path without trailing '/' or '\' (eg. '/users/sampleUser', not '/users/sampleUser/') * @return int size in bytes */ function calc_dir_size($path) { $size = 0; { { $current_path = $path . '/' . $entry; { $size = calc_dir_size($current_path); } } } return $size; }