Is there any way you can convert "185,345,321" to 185345321 by using PHP?
Yes, it's possible:
$str = "185,345,321";
$newStr = str_replace(',', '', $str); // If you want it to be "185345321"
$num = intval($newStr); // If you want it to be a number 185345321
This can be achieved by-
$intV = intval(str_replace(",","","185,345,321"));
Here intval()
is used to convert string
to integer
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With