Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
urldecode和pluses-PHP_Php_Urldecode - Fatal编程技术网

urldecode和pluses-PHP

urldecode和pluses-PHP,php,urldecode,Php,Urldecode,我有一个表单字段,我将查询字符串链接到其中 只要它是URL解码的,它就被清理了,然后我加入了htmlentities,这样它就不会创建有缺陷的HTML 换言之: <input type="text" name="example" value="<?php echo htmlentities((urldecode($_GET["example"])); ?>" /> 已对$\u GET数组中的字符串进行URL解码。你不应该再这样做了 另一方面,如果您真的想在查询字符串中插

我有一个表单字段,我将查询字符串链接到其中

只要它是URL解码的,它就被清理了,然后我加入了htmlentities,这样它就不会创建有缺陷的HTML

换言之:

<input type="text" name="example" value="<?php echo htmlentities((urldecode($_GET["example"])); ?>" />

已对
$\u GET
数组中的字符串进行URL解码。你不应该再这样做了


另一方面,如果您真的想在查询字符串中插入加号,则应该首先对其进行URL编码。

$\u GET应该已经为您进行了URL解码。您不需要手动对其进行URL解码。