Possible Duplicate:
How to decode numeric HTML entities in PHP
How does one remove/replace ”
characters from a string?
I've tried html_entity_decode
but it don't seem to work. There are other similar characters in the string that don't seem t开发者_Go百科o be converted or removed.
Any ideas?
The issue is that html_entity_decode()
doesn't translate numeric entities.
I added an answer to the suggested duplicate How to decode numeric HTML entities in PHP
str_replace(array('”', '”'), '', $thestring);
Here is a working example: http://codepad.org/gXrZcxaF
Does this do what you're looking for:
- http://shiflett.org/blog/2005/oct/convert-smart-quotes-with-php Converting smart quotes and other characters with PHP so they display correctly
- http://ca2.php.net/manual/en/function.htmlentities.php#84612 Dealing with Numeric entities in PHP (comment on the manual)
精彩评论