我正在尝试使用 php 检索 RSS 提要。xml 有许多不同的节点。我不确定如何显示<dc:>,<rdf:>,<syn:>
节点。
喂养
<item>xxx</item>
....
....
<dc:name>John</dc:name> //I am not sure how to get this content
<dc:title>Manager</dc:title>
<syn:updateTime>1970-01-01</syn:updateTime>
<rdf:Seq>
<rdf:li rdf:resource="http://xxx/>
<rdf:li rdf:resource="http://xxx/>
</rdf:Seq>
php
$contents= file_get_contents($url);
$results=new SimpleXMLElement($contents);
//not sure what I can do to display those special nodes...
foreach ($results->channel as $node):
echo $node->item; //only show item content
endforeach;