php 网址参数字符串转换成数组和数字转换成网址字符串
作者:互联网
1.我们经常接收到网址get字符串,需要将字符串转成成数组使用
$str="tn=a&ie=utf-8&bs=httpbuildurl&f=3" $data = []; parse_str($str,$data); var_dump($data);
2.我们经常需要将数组转化成字符串
$data = [ 'tn'=>a, 'utf-8'=>httpbuildurl, 'f'=>3 ]; $url = http_build_query($data); //输出tn=a&ie=utf-8&bs=httpbuildurl&f=3
标签:转换成,utf,tn,网址,str,httpbuildurl,字符串,data 来源: https://www.cnblogs.com/feimengv/p/15666275.html