Convert ' to an apostrophe in PHP

Viewed 26692

My data has many HTML entities in it (• ...etc) including '. I just want to convert it to its character equivalent.

I assumed htmlspecialchars_decode() would work, but - no luck. Thoughts?

I tried this:

echo htmlspecialchars_decode('They're here.');

But it returns: They're here.

Edit:

I've also tried html_entity_decode(), but it doesn't seem to work:

echo html_entity_decode('They're here.')

also returns: They're here.

6 Answers
Related