htmlspecialchars code example
Example 1: html special characters php
$string = "This is testing message "ETC" ";
htmlspecialchars($string, ENT_COMPAT)
Example 2: htmlspecialchars
<?php
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new; // <a href='test'>Test</a>
?>