<?
function human_readable($bytes){
	if (!$bytes) $bytes = 0;

	if ($bytes / 1048576 > 1)
		return round($bytes / 1048576, 1) . 'MB';
	elseif ($bytes / 1024 > 1)
		return round($bytes / 1024, 1) . 'KB';
	else
		return round($bytes, 1) . ' Bytes';
}
?>