<?php
$doc = new DOMDocument();
$doc->load(“news.xml”);
$items = $doc.getElementsByTagName(“item”);
?>
i am trying to use the code above to load the news.xml file and to save the item node into the item variable. However i keep getting the Fatal error: Call to undefined function getelementsbytagname() erorr.
Below is the xml file any ideas why this is happening?
<?xml version=”1.0″ encoding=”UTF-8″?>
<rss version=”2.0″ xmlns:atom=”
<channel>
<item>
<title>blog post1</title>
<link>link to site</link>
<description> blogdescription</description>
</item>
<item>
<title>blog post2</title>
<link>link to site</link>
<description> blogdescription</description>
</item>
<item>
<title>blog post3</title>
<link>link to site</link>
<description> blogdescription</description>
</item>
<item>
<title>blog post4</title>
<link>link to site</link>
<description> blogdescription</description>
</item>
<title>The Unified Feed</title>
<link>
<description>product updates and new</description>
<ttl>60</ttl>
<atom:link href=”
</channel>
</rss>
any help would be appreciated ?.