当前位置:Gxlcms > PHP教程 > url拼接有没有函数可以直接完成的?

url拼接有没有函数可以直接完成的?

时间:2021-07-01 10:21:17 帮助过:32人阅读

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=

$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

人气教程排行