⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

The html_entity_decode() Function

The html_entity_decode() function is the opposite of the htmlentities() function. It is useful when you retrieve data from a database or a form that is safely encoded as HTML entities (e.g., <), and you want to display them as regular characters or use them within your code.

Note for the simulator: Since some string functions (such as htmlentities, htmlspecialchars, and html_entity_decode) modify raw HTML characters, the browser in the output window might not always display the exact raw output (as it automatically processes it). To see how these functions truly behave, we highly recommend copying and testing the code locally in your IDE (e.g., PhpStorm, VS Code).

EXAMPLE
RESULT

Flags and Character Sets

Flags determine how the function handles quotation marks:

  1. ENT_COMPAT: Decodes double quotes only (default).
  2. ENT_QUOTES: Decodes both double and single quotes.
  3. ENT_NOQUOTES: Leaves quotation marks untouched.

Various document types are supported (HTML5, XML, XHTML), and by default, the UTF-8 character encoding is used, which includes almost all global characters and symbols (emojis).