The htmlentities() function converts characters to HTML entities. To convert HTML entities to characters, use the html_entity_decode() function. Use the get_html_translation_table() function to return the translation table used by htmlentities().
(Optional) Specify how to handle quotation marks, invalid encoding, and the document type used.
ENT_COMPAT - Default. Encodes double quotes only.
ENT_QUOTES - Encodes double and single quotes .
ENT_NOQUOTES - Do not encode quotes.
ENT_IGNORE - The function ignores invalid encodings instead of returning an empty string. Avoid as it may affect security.
ENT_SUBSTITUTE - Replaces invalid encodings in the specified character set with the Unicode replacement character U+FFFD (UTF-8) or FFFD; instead of returning an empty string.
ENT_DISALLOWED - Replaces code points that are invalid in the specified document type with the Unicode replacement character U+FFFD (UTF-8) or FFFD;
character-set
(Optional) A string indicating which character set to use.