Uncategorized

htmlspecialchars — Convert special characters to HTML entities

<?php
$new = htmlspecialchars(“<a href=’test’>Test</a>”, ENT_QUOTES);
echo $new; // &lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;
?>

Leave a Reply

Your email address will not be published. Required fields are marked *