欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php使用curl打開(kāi)https網(wǎng)站的方法

 更新時(shí)間:2015年06月17日 10:02:01   作者:RobinTang  
這篇文章主要介紹了php使用curl打開(kāi)https網(wǎng)站的方法,涉及php使用curl連接網(wǎng)站及獲取信息的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了php使用curl打開(kāi)https網(wǎng)站的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

$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;

希望本文所述對(duì)大家的php程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論