How could I extract the string \"text\" from this markup using the PHP DOM?
notthistext
You can access DOMText node directly using XPath:
DOMText
$xpath = new DOMXPath($dom_document); $node = $xpath->query('//div/text()')->item(0); echo $node->textContent; // text