Assume I have a dom_document containing the following html and it is put in a variable called $dom_document
<div>
<a href='something'>some text here</a>
I want this
</div>
What i would like is retrieve the text that is inside the div tag (‘I want this’), but not the a tag. What i do is the following:
$dom_document->nodeValue;
Unfortunately with this statement I have the a tag in with it. Hope someone can help. Thank you in advance. Cheers. Marc
You can use XPath for it: