Using the PHP DOM functions, how do you convert the contents of the DOM Node to a string?
<foo>
Blah blah <bar baz="1">bah</bar> blah blah
</foo>
Given foohow the current context is a node, how do you get 'Blah blah <bar baz="1">bah</bar> blah blah'as a string? Using $node->textContentor $node->nodeValuejust returns text nodes, not <bar baz="1">.
Basically, the equivalent of a Javascript property innerHTML...
source
share