<?php function cdata_handler ($parser, $data) { print ($data); } $xml = "<para>some character data</para>"; $parser = xml_parser_create (); xml_set_character_data_handler ($parser, 'cdata_handler'); if (xml_parse ($parser, $xml, true)) print ("Your XML document is well-formed."); else print ("Your XML document is not well-formed."); xml_parser_free ($parser); ?>
|