I have following html:
<html ><body >Body text <div >div content</div></body></html>
How could I get content of body without nested <div>
?
I need to get 'Body text', but do not have a clue how to do this.
result of running
$domhtml = DOMDocument::loadHTML($html);
print $domhtml->getElementsByTagName('body')->item(0)->nodeValue;
is 'Body textdiv content', which is not exactly what I want to get