作者:梦里的天真575 | 来源:互联网 | 2016-03-16 00:18
dom获取XML的简单例子
[php]
load('http://www.dayanmei.com/feed.php');
$topic = $doc->getElementsByTagName('title');
$link = $doc->getElementsByTagName('link');
$da = $doc->getElementsByTagName('pubDate');
for($i=1;$i<=10;$i++){
echo "item($i)->nodeValue."" target="_blank">".$topic->item($i)->nodeValue." ".substr($da->item($i)->nodeValue,0,25)."
";}
?>
[/php]