Suppose I have a string:
$string = 'apple, cat, dog, "0,445",symphony, "0,454"';
What output I want is:
$string = 'apple, cat, dog, "0.445",symphony, "0.454"';
You can do that using preg_replace
$string = preg_replace('/("\d+),(\d+")/','$1.$2',$string);
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