《PHP編程:php使用curl打開https網(wǎng)站的方法》要點:
本文介紹了PHP編程:php使用curl打開https網(wǎng)站的方法,希望對您有用。如果有疑問,可以聯(lián)系我們。
PHP實例本文實例講述了php使用curl打開https網(wǎng)站的辦法.分享給大家供大家參考.具體實現(xiàn)辦法如下:
PHP實例
$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實例希望本文所述對大家的php程序設(shè)計有所贊助.
《PHP編程:php使用curl打開https網(wǎng)站的方法》是否對您有啟發(fā),歡迎查看更多與《PHP編程:php使用curl打開https網(wǎng)站的方法》相關(guān)教程,學精學透。維易PHP學院為您提供精彩教程。
轉(zhuǎn)載請注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/10334.html