htmlspecialchars()

It convert special characters to HTML entities

Example

<?php
echo htmlspecialchars(“<a href=’http://phpcodez.comt’>phpcode</a>”);
?>

Output

<a href=’http://phpcodez.comt’>phpcode</a>

Share