This article illustrates how to remove a slash when PHP implements a form submission. Share to everyone for your reference, specific as follows:
<title>html form </title>
<form action= "" method= "POST" >
<input type= "text" size= "name=" str "value=" ">
<input type= "Submit" name= "Submission" value= "submitted" ><br/>
if (Isset ($_post[' submit ')) {
This a "test", 5.3.8 does not automatically add slashes, I test this is the
echo "Prototype output:". $_post[' str '. " <br/> ";
echo "Convert instance:". Htmlspecialchars ($_post[' str '). " <br/> ";
echo "Remove Slash:". Stripslashes ($_post[' str '). " <br/> ";
echo "Remove slash and convert entity:". Html2text ($_post[' str '). " <br/> ";
Functionhtml2text ($input) {
Returnhtmlspecialchars (Stripslashes ($input));
$str = "<font color= ' Red ' size=7>linux</font><i>apache</i><u>mysql</u><b >PHP</b> ";
Echostrip_tags ($STR);//delete all HTML tags
Echostrip_tags ($str, "<font>");//second argument, reserved label
Echostrip_tags ($str, "<b><u><i>");
|
--> -->