Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Extends SimpleXMLElement to support writing CDATA
class SimpleXMLExtended extends SimpleXMLElement
// Inspired by:
public function addCDATA($string)
$node = dom_import_simplexml($this);
$nodeOwner = $node->ownerDocument;
public function appendChildWithCDATA($key, $value)
Copy link

vicgonvt commented Aug 11, 2018


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment