我正在尝试解析雅虎管道 rss 提要。这是饲料
<channel>
.......
<item>
......
<media:content url="http://cdn.c.photoshelter.com/img-get/I0000IhrAERY1qOs/s/900/900/Indonesia-Java-Bandung-3106-Bandung.jpg" />
<media:thumbnail url="http://cdn.c.photoshelter.com/img-get/I0000IhrAERY1qOs/s/900/900/Indonesia-Java-Bandung-3106-Bandung.jpg" />
</item>
</channel>
如何<media:thumbnail
从该 RSS 提要中获取图像 ( )?我已经尝试过这个,但没有结果。这是我的代码
<? $feed = file_get_contents('http://pipes.yahoo.com/pipes/pipe.run?_id=ce435780a2b72feb40c0b7446b92e660&_render=rss');
$rss = new SimpleXmlElement($feed);
foreach ($rss->channel->item as $item) {
$ns_dc = $item->children('http://search.yahoo.com/mrss/');
echo $ns_dc->thumbnail ; echo '<br>';
}
?>
问题是“SimpleXmlElement”不生成类别名称和媒体缩略图。请帮帮我谢谢!