Remove Commas From A String – str_replace()
If you find that you have a string that contains commas and you need to remove them you can do the following. Let’s assume your string looks like this. Now let’s strip those ugly commas from our variable $myString using the str_replace() function. That’s it, enjoy!