您好,欢迎访问一九零五行业门户网

PHP教程:php抓取https的内容_PHP教程

php教程:php抓取https的内容 直接用file_get_contents,会报错;
程序代码$url = (https://xxx.com);
file_get_contents($url);
错误:
程序代码warning: file_get_contents(https://xxx.com) [function.file-get-contents]: failed to open stream: no such file or directory in d:wampwwwgrabber_clientindex.php on line 3
用curl的方式是可以的:
程序代码$url = (https://xxx.com);
$ch = curl_init();
curl_setopt($ch, curlopt_url,$url);
curl_setopt($ch, curlopt_ssl_verifypeer, false);
curl_setopt($ch, curlopt_ssl_verifyhost, false);
$result = curl_exec($ch);
print_r($result);
?>
重点是以下两句:
curl_setopt($ch, curlopt_ssl_verifypeer, false);
curl_setopt($ch, curlopt_ssl_verifyhost, false);
        注:更多精彩教程请关注帮客之家设计教程 栏目,
http://www.bkjia.com/phpjc/1018375.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/1018375.htmltecharticlephp教程:php抓取https的内容 直接用file_get_contents,会报错; 程序代码$url = (https://xxx.com); file_get_contents($url); 错误: 程序代码warning: file_get_con...
其它类似信息

推荐信息