3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = '12,5'; $temp = filter_var($number, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_THOUSAND); var_dump($temp);
based on 0WCOV
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.21, 7.4.0 - 7.4.10, 8.0.0alpha1 - beta3
string(4) "12,5"