URL传参加密 解密后如何获取数据

WBOY
Release: 2016-06-23 13:24:41
Original
1227 people have browsed it

URL传参加密


解密后得到 qq=xxx&ww=qqqqq&m=15010101817&rf=qwqw&ip=192.168.1.1
接下来我要怎样得到每个值呢
截取的话有些值的长度不一定的
按=之后&之前的话 多个=&怎么区分
求教这里要怎么来得到每个值


回复讨论(解决方案)

parse_str

$str = 'qq=xxx&ww=qqqqq&m=15010101817&rf=qwqw&ip=192.168.1.1 ';$arr = explode('&', $str);foreach($arr as $k=>$v){ $res[$k] = explode('=', $v); $ret[] = $res[$k][1];}print_r($ret);
Copy after login

$s = 'qq=xxx&ww=qqqqq&m=15010101817&rf=qwqw&ip=192.168.1.1';parse_str($s, $a);print_r($a);
Copy after login
Array( [qq] => xxx [ww] => qqqqq [m] => 15010101817 [rf] => qwqw [ip] => 192.168.1.1)
Copy after login

原来有专门的函数 多谢指教
这么点分不够分 望见谅

source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!