what's the best way to handle single & double quotes?
Moderator: General Moderators
-
someguyhere
- Forum Contributor
- Posts: 181
- Joined: Sun Jul 27, 2008 3:24 pm
what's the best way to handle single & double quotes?
I'm working on a plugin for wordpress, and one of the fields is a bio field. Is there a good/right way to safely turn regular quotes (like " or ') into curly quotes - and is there a way to turn the quotes pasted from Word into the appropriate quotes rather than them displaying as an unknown character?
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: what's the best way to handle single & double quotes?
Wouldn't the following suffice : htmlentities($valueToEntitize, ENT_QUOTES)?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
-
someguyhere
- Forum Contributor
- Posts: 181
- Joined: Sun Jul 27, 2008 3:24 pm
Re: what's the best way to handle single & double quotes?
No. That doesn't convert regular quotes into curly quotes.