Home > Backend Development > PHP Tutorial > url拼接有没有函数可以直接完成的?

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

WBOY
Release: 2016-06-06 20:40:40
Original
1350 people have browsed it

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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template