我试图在PHP中提交表单期间删除特殊字符。我每次都要提交数据,例如:
<form action="?" method="get">
<input type="text" name="str" value="I want to remove this" />
</form>
浏览器中的输出如下所示
http://localhost/?str=I+want+to+remove+this
无论如何我们可以摆脱那些&#34; +&#34;在提交之前或提交期间?
我的预期结果是
http://localhost/?str=I want to remove this
感谢您的帮助......
答案 0 :(得分:2)
在网址中,您不能在服务器端拥有空格
str=I+want+to+remove+this
将被视为
str=I want to remove this
只。所以我认为你真的不需要担心这种编码。