loadXML($xml); $xp = new DOMXPath($dom); $xp->registerNamespace("rss", "http://purl.org/rss/1.0/"); $xp->registerNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); $links = array(); $n = 0; foreach ($xp->query("//rss:item") as $item) { $url = $item->getAttribute("about"); $title = $xp->query("rss:title/text()", $item)->item(0)->data; $desc = $xp->query("rss:description/text()", $item)->item(0)->data; $links[] = array( 'link' => $url, 'title' => $title, 'description' => $desc, ); if (++$n >= 10) break; } return $links; } ?>