You can access DOMText
node directly using XPath:
$xpath = new DOMXPath($dom_document);
$node = $xpath->query('//div/text()')->item(0);
echo $node->textContent; // text
More Related Contents:
- How do you parse and process HTML/XML in PHP?
- Grabbing the href attribute of an A element
- How do you parse and process HTML/XML in PHP?
- Remove a child with a specific attribute, in SimpleXML for PHP
- Selecting a css class with xpath
- How do you parse and process HTML/XML in PHP?
- How to insert HTML to PHP DOMNode?
- How to parse HTML in PHP?
- How to extract a node attribute from XML using PHP’s DOM Parser
- DOM parser that allows HTML5-style
- Using PHP to get DOM Element
- Simplify PHP DOM XML parsing – how?
- How to display XML in HTML in PHP?
- Call to undefined method DOMDocument::getElementsByClassName() [duplicate]
- PHP DOM get nodevalue html? (without stripping tags)
- Printing content of a XML file using XML DOM
- How do I iterate through DOM elements in PHP?
- Strip HTML tags and its contents
- PHP XML inserting element after (or before) another element
- Wrap DOM element in another DOM element in PHP
- How to get the value from and save to Database in php
- check if link “still” exists [duplicate]
- How to execute a line of code once?
- How do I add PHP code/file to HTML(.html) files?
- Displaying HTML with Blade shows the HTML code
- How can I select and upload multiple files with HTML and PHP, using HTTP POST?
- Dynamically display a CSV file as an HTML table on a web page
- What are .tpl files? PHP, web design
- How can I echo the whole content of a .html file in PHP?
- How to wrap long lines without spaces in HTML?