PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php function formatSize($size) { $types = ["B", "KB", "MB", "GB"]; $type = current($types); while ($size / 1024 > 1 && $type = next($types)) { $size = (int)($size / 1024); } return $size . " " . $type; } echo formatSize(1024*1024*1024*1024*1024);
Show:  
Copy Clear