XML parsing
| From: | Peter Lauri | Date: | Thu, 09 Feb 2006 10:17:53 +0000 |
| Subject: | XML parsing | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-230145@lists.php.net to get a copy of this message | ||
Hi,
When I go thru this documentation the parsing seem to be very complex. With
Java this was not the case.
Assume I have XML like this:
$xml = '<greeting><from>Peter</from><to>The
group</to></greeting>';
I would like to get the value of 'from' and 'to'.
My dream function would be:
$from = xml_function($xml, 'from');
$to = xml_function($xml, 'to');
Or maybe an function that create an array from the XML:
$arr = xml_to_array($xml);
Any one who can give a really SIMPLE example of this?
I would LOVE you.