Here is how to add a CDATA section to an XML node in PHP. Assuming that $myxmlnode is your php variable representing an xml node, you will have to use dom import to add a CDATA section to that xml node. Here is the code snippet below for the same.
$dom=dom_import_simplexml($myxmlnode);
$dom->appendChild($dom->ownerDocument->createCDATASection("Add any text here"));


About Me
Software Architect by profession and passion. I offer a
variety of services in software development. Contact me if you are looking for custom software development, software consultancy, building websites, developing games, authoring wordpress plugins, desiging flash applications, solutions in PHP/MySQL / Microsoft.Net/Silverlight / Flash/Action Script / Java/VC++ etc.
No Comments Yet - be the First!