21,882
社区成员
发帖
与我相关
我的任务
分享
<?php
$handle=fopen("http://163.com",r);
while(!feof($handle))
{
// Read each line and add to $myLine
$myLine.=fgets($handle,255);
}
echo $myLine;
fclose($hanle);
?>
//你这样测试
//假如是本机,假如文件是s.php user_agent="PHP"前面分号去掉
if(isset($_GET['t']))
{
print_r(apache_request_headers());
}
else
{
echo file_get_contents("http://localhost/s.php?t=1");
}