how to convert php variable string to int -
how convert string variable integer
2, 990.00 i want output this
2990.00 if add 2 numbers
$num1 = '2, 990.00'; <br> $num2 = '7, 990.00'; <br> <br><br> $ans = $num1 + $num2;<br> echo $ans; answers 9
you can use preg_replace("/[^0-9.]/", "", $subject) eliminate non-numeric characters.
Comments
Post a Comment