I can formating number 169480 to 169,480.
But I can't 169,480 to simple 169480.
How can I do this?
I don't need any decimals and comma just a simple number.
This should work for you:
(I just use str_replace()
to replace '
, .
and ,
with a empty string)
<?php
$number = "169,480";
echo str_replace(array("'", ".", ","), "", $number);
?>
Output:
169480
Try this..
If number have any "," or "." means following code use for remove that
<?php
$number="169,480";
echo str_replace([',', '.'], '', $number);