3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function formatBytes($size, $precision = 2) { $base = log($size) / log(1024); $suffixes = array('', 'k', 'M', 'G', 'T'); return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)]; } echo formatBytes(24962496);
based on AOsFT
Output for 4.3.0 - 7.1.0
23.81M