Rumah >pembangunan bahagian belakang >tutorial php >url拼接有没有函数可以直接完成的?
array(
'url' => '111',
'desc' => '123',
'type' => 'share',
'showcount' => '',
);
转换成:
url=111&desc=123&type=share&showcount=
array(
'url' => '111',
'desc' => '123',
'type' => 'share',
'showcount' => '',
);
转换成:
url=111&desc=123&type=share&showcount=
<code>$data = array( 'foo' => 'bar' , 'baz' => 'boom' , 'cow' => 'milk' , 'php' => 'hypertext processor' ); echo http_build_query ( $data ) ; //foo=bar&baz=boom&cow=milk&php=hypertext+processor </code>