http_build_query()
$data = array("name"=>"callback" , "value"=>"test");
$rescult = http_build_query($data);
输出下$rescutl可以得到:
name=callback&value=test
parse_url()
$url="https://i.cnblogs.com/EditPosts.aspx?opt=1";
print_r(parse_url($url));
/*
* 输出
Array
(
[scheme] => https
[host] => i.cnblogs.com
[path] => /EditPosts.aspx
[query] => opt=1
)
* */
parse_str
$str="name=jack&age=32";
parse_str($str,$arr);
print_r($arr);
/*输出
Array
(
[name] => jack
[age] => 32
)
*/