Skip to content Skip to sidebar Skip to footer

Php Domdocument Get Text After Tag

I have this in my php file.

Text

I need this text...

next p

... and this
'; $dom=ne

Solution 1:

Use DOMXPath:

$xpath = new DOMXpath($domDocument);

foreach ($xpath->query('//div/text()') as$textNode) {
    echo$textNode->nodeValue;
}

Post a Comment for "Php Domdocument Get Text After Tag"