Page 1 of 1

How to parse a string in xml?

Posted: Sat Aug 12, 2006 10:18 am
by PHP_UPS
Hi all,

In PHP, xml_parser() function works only for xml documents. But I have a string containing XML tags. And xml_parser() is not working for that. So plz someone show me a way to parse an XML string in PHP.

Thanking you.

Posted: Sat Aug 12, 2006 10:32 am
by Uranium-235
as far as I know it should work. PHP's XML parser takes a string of XML data as the second argument.

Posted: Sat Aug 12, 2006 10:34 am
by Ambush Commander
If you want to do it quick-n-dirty, just wrap the text in a top-level tag like <all> or something. Then parsing should work.