htmlentities() function converts all characters into their equivalent HTML entities. : htmlentities « HTML « PHP






htmlentities() function converts all characters into their equivalent HTML entities.

 
The syntax is: string htmlentities (string string)

<?
$user_input = "costs < $42.25.";
$converted_input = htmlentities($user_input);
print $converted_input;
?>
  
  








Related examples in the same category

1.Checking for magic quotes
2.Generating XML from an array
3.htmlentities.php
4.Encoding HTML entities in a string
5.Escaping HTML