HTML Special Character Converter
The easiest way to set a charset in your HTML is by using the Content-Type META tag. But if for some reason you cannot define a character set in your HTML files, you can HTML-encode special characters (such as characters with accents or the €-character). Your character will be shown correctly in almost all cases (if your font supports the character). HTML-encoded characters always start with an ampersand (&) and end with a semicolon (;).
Use htmlentities( string [, quote style, charset ] ) to convert your characters to HTML enconded characters. Example:
htmlentities('ë', ENT_COMPAT, 'UTF-8')
This outputs ë (and the string is HTML encoded)
ENT_COMPAT will convert double-quotes and leave single-quotes alone.
You can also specify a charset to define which charset should be used in the conversion. The default is UTF-8 (PHP 5.4.0+, default=ISO-8859-1/Latin 1for older PHP versions).