|
I use SimpleXML pretty much exclusively for this stuff: $data=''; $xml=simplexml_load_string($data); foreach ($xml->that as $item){ print_r($item); echo "<hr>"; } Returns: SimpleXMLElement Object ( [@attributes] => Array ( [parm1] => a [parm2] => b [parm3] => c ) [0] => red ) SimpleXMLElement Object ( [@attributes] => Array ( [parm1] => e [parm2] => f [parm3] => d ) [0] => blue ) Which is what it should. You can also use XPath to get at what you want: $xpath = $xml->xpath('/this/that'); Which would return an array of each <that> item along with the attributes. Jamie Holly http://www.intoxination.net http://www.hollyit.net On 3/24/2011 9:09 PM, [email protected] wrote: When all else fails, and #xml, ##php and #drupal-support come up empty...ask the folks who actually code :) |
- [development] trouble destructing xml jeff
- Re: [development] trouble destructing xml Dave Metzler
- Re: [development] trouble destructing xml Jamie Holly
- Re: [development] trouble destructing xml Matt
- Re: [development] trouble destructing xml Scott Reynen
- Re: [development] trouble destructing xml David Metzler
- Re: [development] trouble destructing xml Victor Kane
- Re: [development] trouble destructing xml Kevin O
