alert('Hello World!');"; $escaped_text = htmlspecialchars($unescaped_text, ENT_QUOTES); // Output: <script>alert('Hello World!');</script> echo $escaped_text; ?>In the above example, the special characters "<" and ">" are converted to their HTML entities "<" and ">", respectively. Similarly, the single quote "'" is converted to "'" to prevent it from being interpreted as an attribute value. The PHP HTML escape function is included in the core PHP library, and no additional package or library is required to use it.