hi there!
i'm working on some piece of code that should get the contents of a very specific html-tag of an html-document given.
$html = "<html>..........truncated.........<div>blablabla<br />xy</div>.....";
$dom = new DomDocument();
$dom->loadHTML($html);
$divs = $dom->getElementsByTagName('div');
echo $divs->item(0)->nodeValue.'<br>';
the html-code is just an example but shows the very problem i'm experiencing: i want to get the content of this DIV and i NEED the inner tags to be kept!
what nodeValue (as well as "textContent") does, is returning the contents of the correct node with all inner tags stripped
(http://docs.php.net/manual/en/class.domnode.php)
i'm out of ideas how to get this right atm... what i need is the equivalent to javascripts "innerHTML" or so... but i cant find such a method :(
how do i get this right?