龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

php 在 PHP 中使用 http_build_query() 构建查询参数

时间:2014-06-20 03:16来源:网络整理 作者:网络 点击:
分享到:
在 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);
?>
精彩图集

赞助商链接