Load XML from a string and do static invocation of loadXML in PHP

Description

The following code shows how to load XML from a string and do static invocation of loadXML.

Example


/*from  www.j  a va  2  s .  c  om*/

<?php
// Issues an E_STRICT error
$doc = DOMDocument::loadXML('<root><node/></root>');
echo $doc->saveXML();
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    XML »




DOM
SimpleXML
SimpleXMLElement
XML Parser