Escaping HTML : htmlentities « HTML « PHP






Escaping HTML

 
<?php
print 'The comment was: ';
print htmlentities($_POST['comment']);
?>
  
  








Related examples in the same category

1.Checking for magic quotes
2.Generating XML from an array
3.htmlentities() function converts all characters into their equivalent HTML entities.
4.htmlentities.php
5.Encoding HTML entities in a string