Home >php教程 >php手册 >php处理url地址获取其中附加信息

php处理url地址获取其中附加信息

WBOY
WBOYOriginal
2016-06-07 11:35:431181browse

利用php处理url信息,获取其中的参数信息
函数定义:    //url信息处理函数<br>     //定义处理函数<br>     function get_url_msg($str){<br>         $data = array();<br>         $parameter = explode('&',end(explode('?',$str)));<br>         foreach($parameter as $val){<br>             $tmp = explode('=',$val);<br>             $data[$tmp[0]] = $tmp[1];<br>         }<br>         return $data;<br>     }函数使用:$url = 'https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token='.$access_token;<br> $data = $this->get_url_msg($url);<br> echo $data['access_token'];

AD:真正免费,域名+虚机+企业邮箱=0元

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