用file_get_contents显示not found
用curl显示302 found
可是直接是能打开的
怎么解决呢
用curl显示302 found
可是直接是能打开的
怎么解决呢
解决方案 »
- 绑定域名的问题,我申请的是CC免费域名
- 问大家一个gbk和gb2312的问题
- supplied argument is not a valid MySQL-Link resource 是什么意思怎么解决?拜托
- php如何清楚cookie
- 有关下载的问题,请高手不吝赐教!!!
- 帮忙给个递归算法
- 一个很有争议的问题
- 急急急,还是验证是否已经登陆的问题
- 使用PHP为App开发后台API接口如何保证接口调用的安全,防止外部恶意调用
- 如何将js获取的值给session
- fopensocket 请求url 应该返回xml文档但是返回http 500 内部错误
- 如何把Discuz论坛中的某个帖子数据读出来?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
echo $data=curl_exec($ch);
curl_close($ch)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
$html = curl_exec($ch);
curl_close($ch);
preg_match_all('/^Location: (?P<location>.*?)$/m', $html, $matches);
echo trim($matches['location'][0]);
//http://www.qzwb.com/jk/content/2013-05/29/content_4458231.htm
结帖率:0%, 20分也要记得结哦。
不是这样的啊,我是想采http://www.qzwb.com/jk/content/2013-05/29/content_4458231.htm这里面的内容,打不开