public function sizePrettyize($size) { $unites = array('o', 'Ko', 'Mo', 'Go', 'To', 'Po'); $n = floor(log($size) / log(1024)); $t = round($size / pow(1024, $n), 1); return $t . ' ' . $unites[$n]; }