Created
December 19, 2013 08:09
-
-
Save extraordinaire/8035934 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getHtmlFromDomElement($element) { | |
$doc = new DOMDocument(); | |
foreach($element->childNodes as $child) | |
{ | |
$doc->appendChild($doc->importNode($child, true)); | |
} | |
return $doc->saveHTML(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment