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

The htmlspecialchars_decode() Function

The htmlspecialchars_decode() function is the opposite of the htmlspecialchars() function. It is used when you want to convert predefined HTML entities (such as &lt;) back into their original characters (<). This is frequently necessary when processing text from databases or text editors.

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

Decoding Special HTML Entities

HTML entities that are decoded by this function:

  1. &amp;amp;: becomes & (ampersand)
  2. &amp;quot;: becomes " (double quote)
  3. &amp;#039;: becomes ' (single quote)
  4. &amp;lt;: becomes < (less than)
  5. &amp;gt;: becomes > (greater than)