DOM Create Element

This function creates a new instance of class DOMElement. This node will not show up in the document unless it is inserted with (e.g.) DOMNode::appendChild().

Example

<?php
 $doc = new DOMDocument();
 $doc->loadXML('<root />');
 $el = $doc->createElement('site','PHPCodez');
 $doc->appendChild($el);
 echo $doc->saveXML();
?>

Leave a Reply

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