DOMElement object to HTML
28/11/2009Here is a quick way to get HTML from a DOMElement in PHP
function getHtmlFromDomElement($element) { $doc = new DOMDocument(); foreach($element->childNodes as $child) { $doc->appendChild($doc->importNode($child, true)); } return $doc->saveHTML(); }
There is 1 comment in this article: