Publisher review:human readable size - to give a user the size of his account To give a user the size of his account (or the admin the size of the users folder) in a more human readable format, you can use this It will return the value in megabytes so its more easy to read.
$varray = explode("&", $_SERVER['QUERY_STRING']); for($x=0; $x= 0) $size = $dirSize; else return -1; } } closedir($DIR); } return $size; } // stolen from another fine user on php.net // function format_size($rawSize) { if ($rawSize / 1048576 > 1) return round($rawSize/1048576, 1) . 'MB'; else if ($rawSize / 1024 > 1) return round($rawSize/1024, 1) . 'KB'; else return round($rawSize, 1) . 'bytes'; } $dir = '/phpsnippets'; $size = dirsize($DOCUMENT_ROOT.$dir); if ($size < 0){ echo '.$dir.'" !'; }else{ echo '.$dir.' folder is ' . format_size($size); } ?>
ERROR! Bad path "'
the '
human readable size is a PHP script for Snippets scripts design by fundisom.
It runs on following operating system: Windows / Linux / BSD.
Operating system:Windows / Linux / BSD