$url="http://www.google.com";$fcontents=file_get_contents($url);//第6行
@eregi("<title>(.*)</title>",$fcontents,$rg);//截取内容echo $rg[1];//输出标题有时能正常显示“Google”但也有时会显示:
Warning: file_get_contents(http://www.google.com) [function.file-get-contents]: failed to open stream: HTTP request failed! in E:\Web\htdocs\index.php on line 6
@eregi("<title>(.*)</title>",$fcontents,$rg);//截取内容echo $rg[1];//输出标题有时能正常显示“Google”但也有时会显示:
Warning: file_get_contents(http://www.google.com) [function.file-get-contents]: failed to open stream: HTTP request failed! in E:\Web\htdocs\index.php on line 6
HTTP请求失败,最近访问google都这样的呢
可能头部没通过验证
试下curl 或者 fsockopen