PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php function ff(int $size) : string { $units = ['b', 'Kib', 'Mib', 'Gib','TiB','PiB','EiB','ZiB','YiB']; $unit = reset ($units); while ($size >= 1024) { $size = intval($size/ 1024); $unit = next($units); } return $size . $unit; } echo ff(74288386);
Show:  
Copy Clear