您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php使用curl打开https网站的方法_PHP教程

2026/2/7 23:09:36发布13次查看
php使用curl打开https网站的方法 这篇文章主要介绍了php使用curl打开https网站的方法,涉及php使用curl连接网站及获取信息的相关技巧,需要的朋友可以参考下
本文实例讲述了php使用curl打开https网站的方法。分享给大家供大家参考。具体实现方法如下:
?
1
2
3
4
5
6
7
8
9
10
11$url = 'https://www.google.com.hk';
$ch = curl_init();
curl_setopt($ch, curlopt_url, $url);
curl_setopt($ch, curlopt_header, false);
curl_setopt($ch, curlopt_returntransfer, true);
curl_setopt($ch, curlopt_ssl_verifypeer, false);
curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (windows nt 6.1) applewebkit/537.11 (khtml, like gecko) chrome/23.0.1271.1 safari/537.11');
$res = curl_exec($ch);
$rescode = curl_getinfo($ch, curlinfo_http_code);
curl_close($ch) ;
echo $res;
希望本文所述对大家的php程序设计有所帮助。
http://www.bkjia.com/phpjc/1017845.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/1017845.htmltecharticlephp使用curl打开https网站的方法 这篇文章主要介绍了php使用curl打开https网站的方法,涉及php使用curl连接网站及获取信息的相关技巧,需要的朋友...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product