比如一个文件  在一个input 里面输入"\" 去fwrite($fp, $content);  就变成了两个"\"给你代码:
<?
$fp = fopen($p, "w");
fwrite($fp, $content);
fclose($fp);
header("Location: manageFile.php?p=".$p);exit;
?>

解决方案 »

  1.   

    string stripslashes ( string str)函数可以去掉2个斜线中的一个
      

  2.   

    这样行吗?反正可以得到你想要的效果,具体处理过程我不知道,:(我够菜
    <?
    if($setp=="")
    {
    ?>
    <form name="FormName" action="qqz.php?setp=1" method="post">
    <input name="t" type="text" value="">
    <input type="submit" value="Send">
    </form>
    <?
    }
    if($setp=="1")
    {
    $fp=fopen("11.txt","w");
    $r=stripslashes($t);
    fputs($fp,$t."\n");
    fclose($fp);
    echo "搞定";
    exit;
    }
    ?>
      

  3.   

    对,就是用这个stripSlashes去斜杠了。
    但是,如果你要将写入的内容读出去的话又要用addSlashes加斜杠了。