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

PHP獲取url的函數(shù)代碼

 更新時(shí)間:2011年08月02日 19:30:00   作者:  
PHP獲取url的html代碼,需要的朋友可以參考下。
復(fù)制代碼 代碼如下:

function geturl($url)
{
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
//在需要用戶檢測(cè)的網(wǎng)頁(yè)里需要增加下面兩行
//curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
//curl_setopt($ch, CURLOPT_USERPWD, US_NAME.”:”.US_PWD);
$contents = curl_exec($ch);
curl_close($ch);
$contents = str_replace("document.write('","",$contents);
$contents = str_replace("');","",$contents);
$contents = str_replace("\\n","",$contents);
$contents = str_replace("\\","",$contents);
echo $contents;
}

相關(guān)文章

最新評(píng)論