HtmlEntities and Apostrophes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jchannon
Forum Newbie
Posts: 12
Joined: Fri Aug 03, 2007 1:55 pm

HtmlEntities and Apostrophes

Post 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!
jchannon
Forum Newbie
Posts: 12
Joined: Fri Aug 03, 2007 1:55 pm

Re: HtmlEntities and Apostrophes

Post by jchannon »

No worries - I sorted it with the MagicQuotes removal function
Post Reply