jd2007 Posted December 12, 2007 Share Posted December 12, 2007 <?php $xml = new DOMDocument(); $xml->load("caldb_users.xml"); $i=$xml->getElementsByTagName("db"); foreach ($i as $x) { echo $x; } ?> Link to comment https://forums.phpfreaks.com/topic/81307-why-domnodelist-can-be-used-with-foreach-below-eventhough-its-an-object/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 12, 2007 Share Posted December 12, 2007 From the php manual - As of PHP 5, it is possible to iterate objects too. Here is even more - http://www.php.net/manual/en/language.oop5.iterations.php Link to comment https://forums.phpfreaks.com/topic/81307-why-domnodelist-can-be-used-with-foreach-below-eventhough-its-an-object/#findComment-412671 Share on other sites More sharing options...
jd2007 Posted December 12, 2007 Author Share Posted December 12, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/81307-why-domnodelist-can-be-used-with-foreach-below-eventhough-its-an-object/#findComment-412680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.