If you just use simple PHP htmlentities function with one argument, you will notice that when you pass string that contains UTF-8 characters, the result is incorrect leaving you with some incorrect characters on the result.
To use it correctly, use this code 🙂
htmlentities($your_string, ENT_COMPAT, 'UTF-8');
2 replies on “PHP HtmlEntities for UTF-8 Characters”
Hi Xrvel
im looking for a programmer to write a word press plug-in for me . please email if you are available.. best wishes Jason
great job 🙂