我使用 SimplePie 在我的页面上显示 RSS 提要。现在我想显示评论的数量。
RSS:
<slash:comments>0</slash:comments>
我怎样才能用 Simplepie 展示这个?
你想用它$item->get_item_tags()
来做到这一点。猜测一下,您需要带有标签的http://purl.org/rss/1.0/modules/slash/
名称空间。comments
$comments = $item->get_item_tags('http://purl.org/rss/1.0/modules/slash/', 'comments');
然后,您可以查看此数据结构以确定您需要什么。估计...
$number = $comments[0]['data'];