This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP SimpleXML Parser

Read From File

SimpleXMLElement Object ( [to] => Tove [from] => Jani [heading] => Reminder [body] => Don't forget me this weekend! )

<?php
// contents of external file (note.xml)
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

// read and display the external file
$xml=simplexml_load_file("include/note.xml") or die("Error: Cannot create object");
print_r($xml);
?>