http_build_query

http_build_query — 生成 URL-encode 之后的请求字符串

$data = array(‘foo’=>’bar’,’baz’=>’boom’,’cow’=>’milk’,’php’=>’hypertext processor’);

echo http_build_query($data) . “\n”;
echo http_build_query($data, ”, ‘&’);

foo=bar&baz=boom&cow=milk&php=hypertext+processor
foo=bar&baz=boom&cow=milk&php=hypertext+processor