url拼接有没有函数可以直接完成的?
程序员文章站
2022-05-10 11:23:42
...
array(
'url' => '111',
'desc' => '123',
'type' => 'share',
'showcount' => '',
);
转换成:
url=111&desc=123&type=share&showcount=
'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=
$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