$_SERVER['QUERY_STRING']的字符串类似:a=1&b=2&c=3&vardate=2012-11-12希望能转换成$_GET数组,内容类似于:$_GET['a']=1;$_GET['b']=2;
$_GET['c']=3;$_GET['vardate']='2012-11-12';我的思路是把原始字符串根据&切分后,再根据=切分。list(,$tmp) = explode("?", $_SERVER['QUERY_STRING']);$a = explode("&",$tmp);foreach($a as $v) { $b = explode("=", $v); $_GET[$b[0]] = $b[1];
}var_dump($_GET);
- 1 回答
- 0 关注
- 88 浏览
添加回答
举报
0/150
提交
取消