Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

David Coallier's Blog:
Quick Tip - PHP, SimpleXML and CDATA
Nov 06, 2007 @ 17:16:00

David Coallier has shared a quick tip today about the PHP/SimpleXML/CDATA combination and the creation of auto-generated classes.

I thought, hey I wonder how long it'd take in php.. so I was working on it and I actually couldn't remember all those funny extra parameters in simplexml_* so if you are googling and cannot find something that says exactly what you want well here it is.

His example includes two additional parameters in his simplexml_load_string call to handle the CDATA section correctly and make accessing the data inside the block just like getting at anything else in the object.

Note that Rob Richards has also commented on the post that this issue was corrected a while back and it shouldn't be needed anymore, but could effect older versions of the SimpleXML functionality.

tagged: simplexml cdata parameter extra simplexmlelement libxmlnocdata simplexml cdata parameter extra simplexmlelement libxmlnocdata

Link:

David Coallier's Blog:
Quick Tip - PHP, SimpleXML and CDATA
Nov 06, 2007 @ 17:16:00

David Coallier has shared a quick tip today about the PHP/SimpleXML/CDATA combination and the creation of auto-generated classes.

I thought, hey I wonder how long it'd take in php.. so I was working on it and I actually couldn't remember all those funny extra parameters in simplexml_* so if you are googling and cannot find something that says exactly what you want well here it is.

His example includes two additional parameters in his simplexml_load_string call to handle the CDATA section correctly and make accessing the data inside the block just like getting at anything else in the object.

Note that Rob Richards has also commented on the post that this issue was corrected a while back and it shouldn't be needed anymore, but could effect older versions of the SimpleXML functionality.

tagged: simplexml cdata parameter extra simplexmlelement libxmlnocdata simplexml cdata parameter extra simplexmlelement libxmlnocdata

Link:


Trending Topics: