各位试试这个http://www.dianping.com/4/info/rss.xml 怎么用file_get_contents错误信息: Warning: file_get_contents(http://www.dianping.com/4/info/rss.xml) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented in D:\Program Files\AppServ\www\fetchrss.php on line 4
2\fsockopen();
3\system("wget ....");
4\curl
是这样,那边已经禁了这个打开文件,我感觉模拟浏览器的方式应该可以下载,但不知如何模拟
就是个小浏览器只有浏览器能打开,他就能打开
cur
fsockopen
怎么用file_get_contents错误信息:
Warning: file_get_contents(http://www.dianping.com/4/info/rss.xml) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented in D:\Program Files\AppServ\www\fetchrss.php on line 4
可能是对方服务器通过验证USER_AGENT判断客户端访问的。
lz可以用PHP做个HTTP客户,虚拟普通浏览器的USER_AGNET信息就可以。
curl应该也可以办到,
如果需要比较可靠的处理,可以用ZF的类库
http://framework.zend.com/manual/zh/zend.http.html