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', 'Kb', 'Mb', 'Gb','Tb']; $unit = reset ($units); while ($size > 1024) { $size = intval($size/ 1024); $unit = next($units); } return $size . $unit; } echo ff(12345666666776789);
Show:  
Copy Clear