I have two characters that I need to do a search and replace on in a php-string.
Somehow these are different from:
Does anyone know what function I might use to strip these from a php string?
That's what happens when someone sends you an email in outlook, so watch out, because you're totally missing the opening pair of those single quotes, and closing pair for the double quotes. But really, you need to be using html entity codes.
Why? Because there's a hell of a lot more out there in the wilderness than those two codes you posted above, in-fact, you've only shown half the set of quotes (ie, you missed the closing single quote, and opening double quote). There's hundreds, you need to be encoding them in a better way than string replace.
There's a couple ways to manage the translation from encoding to html entity.
There's more also, but they basically do the same thing.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki