Re: Getting data from XML
| From: | Jason Barnett | Date: | Sun, 18 Jul 2004 23:13:44 +0000 |
| Subject: | Re: Getting data from XML | ||
| References: | 1 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-426@lists.php.net to get a copy of this message | ||
Eamon Reyn wrote:
Hey People, I was wondering if anyone could point me to an example or give me an example of data extraction from an XML document where you do not necessarily know the contents of the XML document. I am using PHP 5 RC3 and can see a lot of references to methods like getelementbytagname or getbyid etc but what if the data I am getting is not what I expected however I still want to display it. How do I go about this. Thanks in advance, Eamon.The easy way to do this is to use SimpleXML and then iterate over each element with a foreach(). You could put this into a function if you want to recursively iterate through every element in the document.