Friday, September 3, 2010

Problem with [[!CDATA ]]

Sometimes when you load the xml file, you didn't get the data between the tags [[!CDATA ]]. This is the character data and you can't get with simplexml_load_file library. In that case use that function as below, so that it will escape the CDATA from url.
$xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA)

No comments: