homepage Welcome to WebmasterWorld Guest from 54.166.84.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
getElementsByTagName().length problem
thecoolone

5+ Year Member



 
Msg#: 3232570 posted 9:10 am on Jan 26, 2007 (gmt 0)

Using PHP DOM XML, I am trying to get the number of nodes in the nodelist by using the length propery of getElementsByTagName.

here's the code:
$doc = new DOMDocument();
$doc->loadXML($response);
$cnt=$doc->getElementsByTagName("entry");
$count=$cnt.length;
print "$count is the length<br>";

but it doesnt give me the length, rather this is the output i get:
"Object id #2length is the length"

Can someone help me out here.
Btw im using PHP5.

Thanx in advance

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved