PHP : Function Reference : DOM XML Functions : DomNode->node_value
salman
To get the contents of the node, which is for instance:
<a>this is a test</a>
To get the string: "this is a test" use:
// assuming dom is an actual xml-dom
$temp = $dom->get_elements_by_tagname("a");
foreach($temp as $nexta) {
echo $nexta->get_content();
}
- Salman http://www.setcomputing.com/
rsl
Inmost work with HTML and browsers you may need to use
$text=utf8_decode($domnode->nodeValue);
or
$text=htmlentities(utf8_decode($domnode->nodeValue));
insted of
$text=$domnode->nodeValue;
To have a browser readable output spetialy if you deal with things like áéúóñ& etc or &áá etc.
|