String replace
Posted: Fri Jul 21, 2017 5:28 am
Hi,
I am trying to make a string to a int.
Heres an example:
Expected output is 567.89. However the output is 567.
How can I get the result I want?
I am trying to make a string to a int.
Heres an example:
Code: Select all
<?php
$a1 = '567,89';
$a1 = (int)str_replace(',', '.', $a1);
echo $a1;
?>
How can I get the result I want?