dom获取XML的简单例子
<?php
$doc = new DOMDocument;
$doc->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 "<a href=\"".$link->item($i)->nodeValue."\" target=\"_blank\">".$topic->item($i)->nodeValue."</a> ".substr($da->item($i)->nodeValue,0,25)."<br />";}
?>