Our blog
PHP SimpleXML CData not loading + solution
The php simpleXML object is my preferred way of working with XML, but it has some unusual quirks that can drive you up the wall. One of these is that, by default, it will not read CDATA within an XML file, and will just leave the node blank.
If you need to access this data then create your xml object like this
$xmlFile = "/path/to/xml/file.xml";
if (file_exists($xmlFile)) {
$xml = simplexml_load_file($xmlFile,'SimpleXMLElement', LIBXML_NOCDATA);
echo $xml->cDataNode;
}
RSS Feed