使用PHP呈现时检测不到RSS提要但检测到呈现为静态XML文件

时间:2015-10-06 22:58:26

标签: php xml rss

我使用来自数组的一些数据生成了一个RSS提要,它验证并符合规范,但当我在PHP中从像http://example.com/feed这样的网址渲染它并尝试在新闻阅读器中打开它时,读者告诉我没有饲料存在。如果我提供的是http://example.com/feed.xml的静态文件,则会加载。我在这里缺少什么?

示例Feed

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>Exampel feed</title>
        <description>Example RSS Feed</description>
        <link>http://www.example.com</link>
        <subtitle>Test feed</subtitle>
        <item>
            <title>Equations</title>
            <link>http://example.com</link>
            <pubDate>Wed, 12 Oct 2015 08:00:00 EST</pubDate>
        </item>
    </channel>
</rss>

我还更改了mime类型header("Content-Type: application/xml; charset=UTF-8");

0 个答案:

没有答案