PHP Doku:: Returns value of a node - function.domnode-node-value.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:

Ein Service von Reinhard Neidl - Webprogrammierung.





(PHP 4 >= 4.1.0)

DomNode->node_value Returns value of a node


string DomNode->node_value ( void )

Returns value of the node. The value has different meanings for the different types of nodes as illustrated in the following table.
Meaning of value
Type Meaning
DomAttribute value of attribute
DomCDataSection content
DomComment content of comment
DomDocument null
DomDocumentType null
DomElement null
DomEntity null
DomEntityReference null
DomNotation null
DomProcessingInstruction entire content without target
DomText content of text

3 BenutzerBeiträge:
- Beiträge aktualisieren...
erlend at nymedia dot no
7.04.2008 17:05
In response to rsl at zonapersonal dot com

Or just make sure you set the right page encoding before you start hot fixing.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Using anything else than Unicode is not really a good strategy anyway.
rsl at zonapersonal dot com
28.01.2006 1:18
Inmost work with HTML and browsers you may need to use


insted of


To have a browser readable output spetialy if you deal with things like & etc or &amp;&aacute;&aacute; etc.
2.10.2003 2:42
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

PHP Powered Diese Seite bei
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)