htmlentities()

It convert all applicable characters to HTML entities

Example

<?php
echo htmlentities(“<a>PHP<a> <br /> <p>HTML</p>”);
?>

Output

<a>PHP<a> <br /> <p>HTML</p>