Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2120340
  • 博文数量: 82
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 880
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-14 00:01
文章分类

全部博文(82)

文章存档

2014年(1)

2011年(1)

2009年(8)

2008年(11)

2007年(13)

2006年(26)

2005年(22)

我的朋友

分类: LINUX

2005-12-22 10:32:22

%3D1
原来用

CODE:
$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)');
就可以了


阅读(1266) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-05-11 15:08:17

NO