Re: SimpleXML/array duality (like particles & waves)

From: Date: Wed, 29 Sep 2010 12:59:03 +0000
Subject: Re: SimpleXML/array duality (like particles & waves)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-308352@lists.php.net to get a copy of this message
On Tue, 28 Sep 2010, Brian Dunning wrote: > I am kind of jacked here. I have a SimpleXML object that's been > converted to an array. In one of the nodes, for no reason I can see, > the array is populated differently if there is only one <order_item> > than if there are multiple <order_item>s. > > [...] > > In case it matters, here is that snip of what the original XML looks > like, it's all good: > <?xml version="1.0" encoding="UTF-8"?> > <order xmlns="http://xxxx.com/xxxx" > version="1.0"> > <order_items> > <order_item> > <order_item_product_code > finish="glossy">1060</order_item_product_code> > <order_item_description>4x5.3 trueDigital print(s)</order_item_description> > </order_item> > <order_item> > <order_item_product_code > finish="glossy">1300</order_item_product_code> > <order_item_description>4x8 photo cards (set of 20)</order_item_description> > </order_item> > </order_items> > </order> What does the XML look like if there's only one order item? Maybe you're losing a level of nesting there? -- Erik Arneson <dybbuk@LNouv.com> GPG Key ID : 1024D/62DA1D25 BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP Office : +1.541.291.9776 Skype : callto://pymander http://www.leisurenouveau.com/

« previous php.general (#308352) next »