a b
both $foo->textContent and $foo->nodeValue return a
$foo->textContent
$foo->nodeValue
a
This might be helpful. Using what I found here and here
$txt = ""; foreach($foo->childNodes as $node) { if ($node->nodeType == XML_TEXT_NODE) { $txt .= $node->nodeValue; } }