.
Divya
In PHP the htmlentities() function used to converts characters to HTML entities.
htmlentities(string,flags,character-set,double_encode)
<!DOCTYPE html>
<html>
<body>
<?php
$str = '<a href="https://www.studentstutorial.com">Go to studentstutorial.com</a>';
echo htmlentities($str);
?>
</body>
</html>
Output
<a href="https://www.studentstutorial.com">Go to studentstutorial.com</a>.