I have a string $test='23487°';
How can I remove all the instances of the little circle that appears in the string using preg replace?
What to I enter for the regex to remove it?
EDIT – as Pekka says, str_replace is better I am now using that. But the little circle is still not recognized by PHP…
You don’t need regex, just
str_replace:The first parameter is the search term – the bit that will be found. The second parameter is the replacement string – the text that will be inserted instead. A blank string means “replace it with nothing”, i.e. “remove it”. The third parameter is the string on which to operate.