【发布时间】:2012-10-18 15:05:12
【问题描述】:
我从 RSS 提要中提取:
如果您使用浏览器导航到该页面,您会得到一个漂亮的 xml 页面。
但是,如果我这样做了
simplexml_load_file("the above url");
在 php 中,我得到了
1: parser error : Document is empty
1: parser error : Start tag expected, '<' not found in my_file
那么为什么浏览器能得到它而PHP却不能呢?
如果我执行file_get_contents("the above url"),函数将失败并返回 FALSE。
【问题讨论】:
标签: php xml-parsing simplexml