I have a CMS running. I am seeing that my CMS users are entering special characters coming from copy & paste actions in Word, etc.
So in the meta description content attribute I am seeing a diamond in place of a slanted single right-quote.
I went into the database and changed the single quote to ’.
So my CMS now renders it’s, for example.
I am trying to do conversion on the string during render using PHP’s htmlentities(), htmlspecialchars_decode(), and html_entity_decode().
Each sanitizing instruction simply renders it’s.
Is there a PHP function I should use to translate? Does it even matter? That is, can I have html codes in a meta tag that is essential for SEO?
Hope this is clear…thanks for any feedback.
This is the one I’ve put together for exactly he same reason. You could remove the strip_tag() line if you are happy to keep HTML in their posts.