【发布时间】:2014-07-24 11:27:31
【问题描述】:
想象我有一个来自网站的 RSS 提要,其中包含该网站的最新消息,
像这样:
http://example.com/feed
现在,我想从这个提要地址获取最新的新闻网址。
像这样:
http://example.com/post/555.php
http://example.com/post/554.php
http://example.com/post/553.php
http://example.com/post/552.php
http://example.com/post/551.php
http://example.com/post/550.php
如何在 PHP 中获取限制为(例如)25 个 url 的 url 列表?
【问题讨论】:
-
@MichaelBellamy 我不需要 Ajax 代码,只需要 PHP 代码和回显 Last URLS。
-
一个 RSS 提要会返回一个 XML 文件,因此请看一下阅读 XML,这样您就可以限制它返回的提要数量。快速搜索发现:bavotasan.com/2010/display-rss-feed-with-php