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

file_get_contents獲取不到網(wǎng)頁內(nèi)容的解決方法

 更新時間:2013年03月07日 11:54:08   作者:  
file_get_contents獲取不到網(wǎng)頁內(nèi)容的解決方法,需要的朋友可以參考一下

復(fù)制代碼 代碼如下:

 <?php
$url = "http://jb51.net/index.html";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
//在需要用戶檢測的網(wǎng)頁里需要增加下面兩行
//curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
//curl_setopt($ch, CURLOPT_USERPWD, US_NAME.":".US_PWD);
$contents = curl_exec($ch);
curl_close($ch);
echo $contents;
?> 

相關(guān)文章

最新評論