phphttp_build_query()构建查询参数的小例子
时间:2021-07-01 10:21:17
帮助过:16人阅读
- /**
- * http_build_query() 构建查询参数
- * edit: bbs.it-home.org
- */
- $vars = array('page' => 4, 'search' => 'this & that');
- $qs = http_build_query($vars);
- $url = 'http://bbs.it-home.org/search.php?' . $qs;
- $page = file_get_contents($url);
- ?>
|