Page 1 of 1

PHP Multi-Dimension array processing

Posted: Sat Jul 03, 2010 10:42 pm
by phpnewbie4
I am a PHP newbie and trying to parse an Amazon order (sample XML attached).

I have found xml_parse_into_struct - which creates the attached XML document.

I am trying to figure out the code that will allow me to get

the address information, &Name, &AddressFieldOne,&AddressFieldTwo,&City,&StateOrRegion,&PostalCode,&CountryCode,&PhoneNumber

The order information (Item, ItemPrice and ItemFees).

I've been searching many PHP examples looking for a sample to model the parsing after.

I've found

"http://www.nusphere.com/kb/phpmanual/fu ... struct.htm?" -- but I don't think this is what I need.

If anyone has examples of processing an XML document with similar arrays like Amazon has in it's order processing (or an Amazon order), I'd appreciate any direction.

Thanks in advance for any pointer.

phpNewbie

Re: PHP Multi-Dimension array processing

Posted: Tue Jul 06, 2010 3:05 pm
by Jade
You might want to check out the PEAR xml parser library: http://pear.php.net/package/XML_Parser/redirected

Re: PHP Multi-Dimension array processing

Posted: Tue Jul 06, 2010 5:21 pm
by John Cartwright
Take a look at SimpleXML and it's user comments.