21,891
社区成员
发帖
与我相关
我的任务
分享
<?php
// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n"
)
);
$context = stream_context_create($opts);
// Open the file using the HTTP headers set above
$file = file_get_contents('http://www.site.com/url.php?user=xxx&time=XXX', false, $context);
?>
//$file是你用get请求的结果, 没有值时为false
<?php
var_dump(file_get_contents('http://www.site.com/url.php?user=xxx&time=XXX'));
?>