The htmlspecialchars() function converts only the essential special characters into their corresponding
HTML entities. This is crucial when outputting data entered by users (e.g., in comment sections), as it prevents anyone
from injecting malicious JavaScript code that would otherwise execute in the browsers of other visitors.
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).
Predefined characters that get converted:
&<>"' (only with ENT_QUOTES)