Page 1 of 1

HtmlEntities and Apostrophes

Posted: Fri Jan 23, 2009 10:49 am
by jchannon
Hi

I have the following which is driving me nuts.

Code: Select all

 
$newdata = htmlentities($value ,ENT_NOQUOTES,"UTF-8");
 
When I enter text such as "Isn't this great", the $newdata variable contains a slash in front of the apostrophe.

I have amended the ENT_NOQUOTES to ENT_QUOTES but that didn't do it.

When I render the data I always use

Code: Select all

html_entity_decode($value->htmlcontent,ENT_NOQUOTES,"UTF-8")
Somewhere amongst encoding/decoding I am getting it wrong slightly. I have also used the ENT_QUOTES in the decode but didn't work.

Any help greatly received!

Re: HtmlEntities and Apostrophes

Posted: Fri Jan 23, 2009 11:18 am
by jchannon
No worries - I sorted it with the MagicQuotes removal function