Encoding HTML entities in a string : htmlentities « HTML « PHP






Encoding HTML entities in a string

 
$comments = htmlentities($_POST['comments']);

print $comments.
  
  








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.Escaping HTML