Hi , I am a Software & Web Developer from Sri Lanka. I am using this blog to post special, new and things to memorize in Software & Web developing. Hope you will also get some benefit from my site.
Thursday, September 9, 2010
PHP - read an xml / rss
$doc = new DOMDocument();
$doc->load('http://www.yourlink.com/yourfile.xml');
$arrFeeds = array();
foreach ($doc->getElementsByTagName('item') as $node) {
$itemRSS = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'pubDate' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue
);
array_push($arrFeeds, $itemRSS);
$job_title = $itemRSS["title"];
$pub_date = $itemRSS["pubDate"];
?>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment