English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP String Character String Functions Manual
The html_entity_decode() function is used to convert HTML entities to their corresponding characters
string html_entity_decode ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = ini_get("default_charset") ])
It is used to convert HTML entities to the application characters
It returns the decoded string.
Serial number | Parameters and descriptions |
---|---|
1 | string It contains information about the input string |
2 | flags Optional. Specifies how quotes are handled and which document type is used.Available quote types:
Additional flags specified for the document type used:
|
3 | Optional. A string that specifies the character set to use. Allowed values:
Note:in PHP 5.4 earlier versions, unrecognized character sets will be ignored and replaced by ISO-8859-1 instead. Since PHP 5.4 Starting from PHP-8 instead. |
Try the following example, convert HTML entities to characters:
<?php $input = "w3codebox\".com\" simply <b>easy</b> learning"; $ab = htmlentities($input); $b = html_entity_decode($ab); echo $b; ?>Test and See‹/›
Output Result-
w3codebox ".com" simply <b>easy</b> learning