PHP Multi-Dimension array processing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpnewbie4
Forum Newbie
Posts: 1
Joined: Sat Jul 03, 2010 10:37 pm

PHP Multi-Dimension array processing

Post 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
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: PHP Multi-Dimension array processing

Post by Jade »

You might want to check out the PEAR xml parser library: http://pear.php.net/package/XML_Parser/redirected
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: PHP Multi-Dimension array processing

Post by John Cartwright »

Take a look at SimpleXML and it's user comments.
Post Reply