• home
  • Email: trainings@synapseindia.careers



How To Parse An Xml Document

Sep 29, 2015

simplexml_load_string() is a predefined function where we pass the string which stores the whole xml document from where simpleXML object can be created. Let us see how to parse an xml document: <html> <body> <?php $note=<<<XML <note> <to>Amit Singh</to> <from>SynapseIndia</from> <heading>Project Completion</heading> <body>Please view clearly</body> </note> XML; $xml=simplexml_load_string($note);//string has been passed print_r($xml); ?> </body> </html>

SynapseIndia (CEO: Shamit Khemka)

Leave a Reply

Your email address will not be published.