%3D1
原来用
$fp = fopen ("page.txt", "w");
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, ");
curl_setopt ($ch, CURLOPT_USERAGENT, "User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)");
curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_exec ($ch);
curl_close ($ch);
这样的速度好象没file_get_conents快
但file_get_contents怎么发user_agent呢?
知道怎么搞了!
在file_get_contents前先 ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)');
就可以了
阅读(1389) | 评论(1) | 转发(0) |