The html_entity_decode() function converts HTML entities to characters.
The html_entity_decode() function is the opposite of htmlentities().
string html_entity_decode ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = ini_get("default_charset") ]] )
More precisely, this function decodes all the entities (including all numeric entities) that a) are necessarily valid for the chosen document type — i.e., for XML, this function does not decode named entities that might be defined in some DTD — and b) whose character or characters are in the coded character set associated with the chosen encoding and are permitted in the chosen document type. All other entities are left as is.
Parameter | Description |
---|---|
string | Required. Specifies the string to decode |
flags | Optional. Specifies how to handle quotes and which document type to use. |
The available quote styles are: | |
Additional flags for specifying the used doctype: | |
character-set | Optional. A string that specifies which character-set to use. |
Allowed values are: | |