Mega Code Archive

 
Categories / Php / HTML
 

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 &amp ""  becomes &quot <   becomes &lt; >   becomes &gt <? $user_input = "<<enough>> & !"; $conv_input = htmlspecialchars($user_input); print $conv_input; ?>