Note Submitter: Mike P Smith (mike dot smith at mehdesigns dot com)
----
Another version of patrick smith's "innerHTML" code: This shortens the foreach loop down to one statement by taking advantage of the "ownerDocument" property of the DOMNode.
<?php
$innerHTML = '';
$doc = new DOMDocument();
$doc->loadHTMLFile($filepath);
$elem = $doc->getElementById($elem_id);
// loop through all childNodes, getting html
foreach ($elem->childNodes as $child) {
$innerHTML .= $child->ownerDocument->saveXML($child);
}
?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.