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.
DomNode::node_value
(PHP 4 >= 4.1.0)
DomNode::node_value — Düğümün deÄŸerini döndürür
Açıklama
string DomNode::node_value
( void
)
Düğümün değerini döndürür. Değer, aşağıdaki tabloda gösterildiği gibi her düğüm türü için farklı anlama gelebilir:
| Düğüm türü | Değerin anlamı |
|---|---|
| DomAttribute | Özniteliğin değeri |
| DomCDataSection | CDATA içeriği |
| DomComment | Açıklama içeriği |
| DomDocument | NULL |
| DomDocumentType | NULL |
| DomElement | NULL |
| DomEntity | NULL |
| DomEntityReference | NULL |
| DomNotation | NULL |
| DomProcessingInstruction | Hedef hariç içeriğin tamamı |
| DomText | Metinsel içerik |
DomNode::node_value
erlend at nymedia dot no
07-Apr-2008 03:05
07-Apr-2008 03:05
rsl at zonapersonal dot com
28-Jan-2006 12:18
28-Jan-2006 12:18
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.
Salman
02-Oct-2003 12:42
02-Oct-2003 12: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
http://www.setcomputing.com/
