note 46025 deleted from function.dom-domdocument-createcdatasection by didou
| From: | didou@php.net | Date: | Fri, 17 Dec 2004 17:32:08 +0000 |
| Subject: | note 46025 deleted from function.dom-domdocument-createcdatasection by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81925@lists.php.net to get a copy of this message | ||
Note Submitter: franp at free dot fr
----
Note that while there is a distinction at creation between text node (createTextNode) and cdata node
(createCDATASection), the textContent property is the one to use equally to return the content of
text nodes and cdata nodes, without distinction :
<?php
$doc->getElementsByTagName("aCDataElement")->item(0)->textContent;
$doc->getElementsByTagName("aTextElement")->item(0)->textContent;
echo $str;
?>