note 90742 added to class.domelement
| From: | DanielMorlock at osu1 dot php dot net | Date: | Thu, 07 May 2009 16:22:28 +0000 |
| Subject: | note 90742 added to class.domelement | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-154319@lists.php.net to get a copy of this message | ||
It would be nice to have a function which converts a document/node/element into a string.
Anyways, I use the following code snippet to get the innerHTML value of a DOMNode:
<?php
function getInnerHTML($Node)
{
$Body = $Node->ownerDocument->documentElement->firstChild->firstChild;
$Document = new DOMDocument();
$Document->appendChild($Document->importNode($Body,true));
return $Document->saveHTML();
}
?>
----
Server IP: 212.124.37.9
Probable Submitter: 91.89.193.80
----
Manual Page -- http://www.php.net/manual/en/class.domelement.php
Edit -- https://master.php.net/note/edit/90742
Del: integrated -- https://master.php.net/note/delete/90742/integrated
Del: useless -- https://master.php.net/note/delete/90742/useless
Del: bad code -- https://master.php.net/note/delete/90742/bad+code
Del: spam -- https://master.php.net/note/delete/90742/spam
Del: non-english -- https://master.php.net/note/delete/90742/non-english
Del: in docs -- https://master.php.net/note/delete/90742/in+docs
Del: other reasons-- https://master.php.net/note/delete/90742
Reject -- https://master.php.net/note/reject/90742
Search -- https://master.php.net/manage/user-notes.php