parsing rss

PHP5’s SimpleXML Now Passes CDATA Content

I didn’t hear big announcement of it, but [deep in the docs][1] (? PHP 5.1.0) you’ll find a note about [additional Libxml parameters][2]. In there you’ll learn about “LIBXML_NOCDATA,” and it works like this:

simplexml_load_string($xmlraw, ‘SimpleXMLElement’, LIBXML_NOCDATA);


Without that option (and with all previous versions of PHP/SimpleXML), SimpleXML just ignores any < ![CDATA[...]]> ‘escaped’ content, such as you’ll find in most every blog feed.



 [1]: http://us3.php.net/manual/en/function.simplexml-load-string.php
 [2]: http://us3.php.net/manual/en/ref.libxml.php#libxml.constants "additional Libxml parameters"