programming-examples/php/String/PHP script to remove comma(s) from the following numeric string.php

8 lines
114 B
PHP
Raw Normal View History

2019-11-15 12:59:38 +01:00
<?php
$str1 = "2,543.12";
$x = str_replace( ',', '', $str1);
if( is_numeric($x))
{
echo $x."\n";
}
?>