Last active
April 18, 2016 17:38
-
-
Save fongreecss/0a90585268b32ee77287409c7a157983 to your computer and use it in GitHub Desktop.
gets innerHtml of an DOM Element
This file contains 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 InnerHTML(DOMNode $element) | |
{ | |
$innerHTML = ""; | |
foreach ($element->childNodes as $child) { | |
$innerHTML .= $element->ownerDocument->saveHTML($child); | |
} | |
return $innerHTML; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment