<html>
<body>
$str = "This is some <b>bold</b> text.";
echo htmlspecialchars($str);
<p>Converting < and > into entities are often used to prevent browsers from using it as an HTML element. This can be especially useful to prevent code from running when users have access to display input on your homepage.</p>
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_string_htmlspecialchars by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:51:06 GMT -->
</html>