这个网页怎么curl不了啊

ndx2008 2012-11-01 09:45:13
之前可以的

<?php
function n_r($url) {
$ch = curl_init();
$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.hahasport.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
@ $c = curl_exec($ch);
curl_close($ch);
$c = mb_convert_encoding($c, 'GBK', 'UTF-8');
return $c;
}
$a = 'http://www.hahasport.com/vt-0/10/42/vt-104227.html';
$str = n_r($a);
echo $str;
?>
...全文
123 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Meteorlet 2012-11-02
  • 打赏
  • 举报
回复
不是已经回答过了吗?
http://topic.csdn.net/u/20121031/20/3cdec2e8-8efe-4b08-8ab6-588fc95ec3a1.html

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧