PHP with XML

SimpleXML is a tree-based parser. SimpleXML provides an easy way of getting an element’s name, attributes and textual content if you know the XML document’s structure or layout. SimpleXML turns an XML document into a data structure you can iterate through like a collection of arrays and objects. Compared to DOM or the Expat parser, SimpleXML takes a fewer lines of code to read text data from an element.

$myXML =
"<?xml version='1.0' encoding='UTF-8'?>
<body>Don't leave me!</body>

$xml=simplexml_load_string($myXMLData) or die("Error: Cannot create object");

Leave a Reply

Your email address will not be published. Required fields are marked *