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; ?>