抓取网页 PHP抓取网页的函数
PHP抓取网页的函数 PHP抓取网页的函数**PHP抓取网页的函数**```{.php}function curl_file_get_contents($durl){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $durl); curl_setopt($
PHP抓取网页的函数
PHP抓取网页的函数
function curl_file_get_contents($durl){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $durl);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_USERAGENT, _USERAGENT_);
curl_setopt($ch, CURLOPT_REFERER,_REFERER_);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$r = curl_exec($ch);
curl_close($ch);
return $r;
}
- 上一篇:Socket php socket客户端类
- 下一篇:PHP的FTP类
精彩图集
精彩文章






