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