RE: Count of elements in XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jay,

Check the example at 
http://www.weberdev.com/Manuals/PHP/function.simplexml-element-children.html

Thanks,
Richard

-----Original Message-----
From: Jay Paulson [mailto:Jay.Paulson@xxxxxxxxxxxxxx] 
Sent: Friday, January 20, 2006 11:06 PM
To: PHP LIST
Subject:  Count of elements in XML

I was wondering if there is a way to get the number of foo elements in my
XML below?  This way I could loop through each element and print out the
attributes.  

$string = "<a>
 <foo name=\"one\" game=\"lonely\">1</foo>
 <foo name=\"two\" game=\"again\">2</foo>
 <foo name=\"three\" game=\"blah\">3</foo>
 <foo name=\"four\" game=\"goodness\">4</foo>
</a>";

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux