PHP html entities
This tutorial focuses on:
- The htmlentities() function
The htmlentities() function
The htmlentities() function converts HTML into HTML entities. < would become <, and > would become >. By doing so, the browser can't run HTML tags that a malicious user might try to inject.
If we did not use the htmlentities() function in the above example, the injected code would execute as intended by the malicious user.