Apologies upfront if this has been asked before but it's not an easy question to search for.
I have MySQL database record with ’ in the string, eg the "main reasons for the economy’s outperformance"
So I retrieve the string in PHP and convert it:
$text = mb_convert_encoding($text, "HTML-ENTITIES", "UTF-8");
Now I have "main reasons for the economy’s outperformance"
So next I try to decode the html:
$text = html_entity_decode($text), ENT_QUOTES, "UTF-8");
And now I'm back to strange characters again, "main reasons for the economy’s outperformance"
So my question is how do I get rid of the characters and deal with text as a human reads it, then (after adding slashes) replace the record in the database? I'd rather not have to replace every strange character or html entity individually in MySQL, but it looks like that's the only thing I know how to do that works.
Thanks for pointers.