如何在表单提交过程中删除URL中的特殊字符


How to remove special characters in URL during Form Submission

我试图在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 

我们是否可以在提交之前或提交过程中去掉这些"+"?

我的预期结果是

http://localhost/?str=I want to remove this

url中不能有空格,在服务器端

str=I+want+to+remove+this 

将被读取为

str=I want to remove this

。所以我认为你不需要担心编码