/    Sign up×
Community /Pin to ProfileBookmark

Fatal error: Call to undefined function getelementsbytagname()

<?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=”http://www.w3.org/2005/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>http://www.unifiedsoftwaresolutions.com/news.xml</link>
<description>product updates and new</description>
<ttl>60</ttl>
<atom:link href=”http://www.unifiedsoftwaresolutions.com/news.xml” rel=”self” type=”application/rss+xml” />
</channel>
</rss>

any help would be appreciated ?.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 14.2012 — PHP uses "->" as the object/member separator, not a "." as in Java or JavaScript. ?
Copy linkTweet thisAlerts:
@jblevins1991authorSep 14.2012 — Thanks lol

Too much time learning JavaScript DOM

javascript dom makes me ?
Copy linkTweet thisAlerts:
@jblevins1991authorSep 14.2012 — Thanks lol

Too much time learning JavaScript DOM

javascript dom makes me ?
×

Success!

Help @jblevins1991 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...