string(0) "" }"/> string(0) "" }">

Home >Backend Development >PHP Tutorial >PHP:没办法获取参数中的html编码值

PHP:没办法获取参数中的html编码值

WBOY
WBOYOriginal
2016-06-06 20:43:30988browse

URL:http://127.0.0.1/test.php?v=h

代码

<code>

<meta charset="utf-8">


<?php var_dump($_GET);
?>


</code>

结果:array(1) { ["v"]=> string(0) "" }

回复内容:

URL:http://127.0.0.1/test.php?v=h

代码

<code>

<meta charset="utf-8">


<?php var_dump($_GET);
?>


</code>

结果:array(1) { ["v"]=> string(0) "" }

关键在于那个&符号让PHP把参数这么理解了v= & #x68,所以自然接受到的就是空了。切记url传参最好都做一次urlencode,而不是base64_encode

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn