Home  >  Article  >  Backend Development  >  为啥不能获取URL中的&后面的参数

为啥不能获取URL中的&后面的参数

WBOY
WBOYOriginal
2016-06-13 12:29:39853browse

为什么不能获取URL中的&后面的参数。
页面的URL是这样的:
page1.php?mod=aa&id=1
用_Get['mod']可以获取到aa.
但是用Get['id']却是空。
如何才能在php中获取到id参数那?
谢谢。你的url得不到id的那个参数的,你得把&转换成&
也就是说你需要把
page1.php?mod=aa&id=1变为page1.php?mod=aa&id=1

&等价于&但在url中不会识别 '&' (ampersand) becomes '&' 
使用htmlspecialchars_decode()print_r($_GET);
Array
(
    [mod] => aa
    [amp;id] => 1
)

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