3v4l.org

run code in 300+ PHP versions simultaneously
<?php function float_strval($fltValue) { $strValue = (string)$fltValue; if (preg_match("/E([\+\-])(\d+)$/", $strValue, $captures)) { if ($captures[1] === '-') { $strValue = number_format($fltValue, $captures[2], '.', ''); } else { $strValue = number_format($fltValue, 0, '.', ''); } } return [$fltValue, $strValue]; } var_dump(float_strval(0.00000021)); var_dump(float_strval(1209381092380198230.123));

preferences:
47.72 ms | 402 KiB | 5 Q