Sponsored By
MindStick SurveyManager
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Home >> Other Programming >> PHP >> How to read xml file in PHP
Author Post

Manoj Bhatt


Total Post: 19
Member Since: 9/29/2011
Points: 97
How to read xml file in PHP
Posted On: 11/30/2011 1:33:08 AM

Hi Everyone,

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

Thanks in advance!

Author Post

Arun Singh


Total Post: 48
Member Since: 7/1/2011
Points: 331
Re: How to read xml file in PHP
Posted On: 12/1/2011 6:41:54 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
            $xmlDoc->load("YourFile.xml");
            $ptag = $xmlDoc->getElementsByTagName('ParentNode');
            $childQType=$ptag->item($i)->getElementsByTagName('ChildNode');
            echo $childQType->item(0)->childNodes->item(0)->nodeValue;  
So in the same manner you can get all nodes values.              
Modified On: 12/1/2011 6:49:25 AM
Report Abuse Form
Reason:    
 
Total Online Users: 5772
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2013MindStick. All Rights Reserved.