I have string
10.2, 200.3, 33.00
and I want it to be replaced as
10,2, 200,3, 33,00
I tried
preg_replace("/[.]$/","/\d[,]$/",$input);
but it is not replacing!
I can't use str_replace
because it's task in university
Do not use regular expresion when dumb str_replace()
suffices:
$str = str_replace('.', ',', $str)
See docs: http://php.net/str_replace
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