Skip to content

Instantly share code, notes, and snippets.

@calvinchengx
Created May 11, 2012 03:37
Show Gist options
  • Save calvinchengx/2657377 to your computer and use it in GitHub Desktop.
Save calvinchengx/2657377 to your computer and use it in GitHub Desktop.
// Use "appendChild" on the CDATA node we created.
$placemarkDescriptionNode = $dom->createElement('description');
$placemarkDescriptionCDATANode = $dom->createCDATASection(html_entity_decode($row['description']));
$placemarkDescriptionCDATANode = $placemarkDescriptionNode->appendChild($placemarkDescriptionCDATANode);
// So we create a wrapper node, called "description".
// Then we create a node that will contain your "CDATA" that's stored in a variable (I get it straight from my database).
// Then we append the CDATA Node into the description/wrapper node.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment