views:

70

answers:

1
$serializer = new XML_Serializer($options); $serializer->serialize($some_array);
$output = $serializer->getSerializedData();

I want to surround an arbitrary element generating XML with an above cord in CDATA, but I can't do it. Will not there be any good method?

XML_SERIALIZER_OPTION_CDATA_SECTIONS = true When I used it with this option, CDATA sticks to all data.

A: 

Just put the cdata tags around the text you want to be in cdata and turn off the automatic cdata option.