htmlspecialchars() function converts a select few characters in the context of HTML into their equivalent HTML entities.
Its syntax is: string htmlspecialchars (string string)
The htmlspecialchars() function currently only converts the following characters:
& becomes &
"" becomes "
< becomes <
> becomes >
<?
$user_input = "<<enough>> & !";
$conv_input = htmlspecialchars($user_input);
print $conv_input;
?>
Related examples in the same category