发布内容为cmd命令行:移动“ D:\ my 1.txt”“ D:\ my 2.txt”
我的PHP代码:
if (!empty($_POST["mechat"])){
$mechat = fopen("mechat","w");
fwrite($mechat,$_POST['mechat']);
}
错误的结果:移动\“ D:\ my 1.txt \” \“ D:\ my 2.txt \”
您可以使用stripslashes
函数从字符串中删除转义斜杠。
因此,在您的情况下,您想使用它fwrite($mechat,stripslashes($_POST['mechat']));
。这样,当您有需要转义的字符时,stripslashes函数将为您完成此操作,并且应该可以正常输出。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句