3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $number1 = round(354.2550, 2); $number2 = round(38456.12, 2); //echo strlen(substr(strrchr($number1, "."), 1)) . "<br />"; //echo strlen(substr(strrchr($number2, "."), 1)); echo number_format($number1, strlen(substr(strrchr($number1, "."), 1)), ',', '.'); echo PHP_EOL; echo number_format($number2, strlen(substr(strrchr($number2, "."), 1)), ',', '.');
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.1.0
354,26 38.456,12
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
354,26 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/jpCem on line 9 PHP_EOL38.456,12