Home > DeveloperSection > Forums > How to read xml file in PHP
Manoj Bhatt
Manoj Bhatt

Total Post:154

Posted on    November-30-2011 1:33 AM


 1 Reply(s)
 1846  View(s)
Rate this:

Hi Guys,

Can someone tell me, how to read xml file in php?


Arun Singh

Total Post:68

Posted on    December-01-2011 6:41 AM

Hi Manoj Bhatt,
To read XML file in PHP, you can use the following code:
 // Create DOMDocument object
           $xmlDoc = new DOMDocument();
// load XML file
            $ptag = $xmlDoc->getElementsByTagName('ParentNode');
            echo $childQType->item(0)->childNodes->item(0)->nodeValue;  
So in the same manner you can get all nodes values.              

Modified On Dec-01-2011 06:49:25 AM

Don't want to miss updates? Please click the below button!

Follow MindStick