Assume I have a page with an input box. The user types something into the input box and hits a button. The button triggers a function that picks up the value typed into the
Try this method to convert a 'string that could potentially contain html code' to 'text format':
$msg = ""; $safe_msg = htmlspecialchars($msg, ENT_QUOTES); echo $safe_msg;
Hope this helps!