php 在 PHP 中使用 http_build_query() 构建查询参数
在 PHP 中使用 http_build_query() 构建查询参数 **php代码**```{.php}lt;?php$vars = array(#39;page#39; =gt; 4, #39;search#39; =gt; #39;this amp; that#39;);$qs = http_build_query($vars);$url = #39;http://www.oschina.net/search.php?#3
php代码
<?php $vars = array('page' => 4, 'search' => 'this & that'); $qs = http_build_query($vars); $url = 'http://www.oschina.net/search.php?' . $qs; $page = file_get_contents($url); ?>
- 上一篇:php $$ 输出变量字符串对应变量的值
- 下一篇:php删除一组文件
精彩图集
精彩文章