Retreving data from an array.

[php]print_r($price->list);[/php]

Is what I’m calling, and my output is:

Array ( [0] => Array ( [PACKAGE] => Array ( [0] => Array ( [ATTRIBUTES] => Array ( [ID] => 0 ) [ZIPORIGINATION] => Array ( [0] => Array ( [VALUE] => 32751 ) ) [ZIPDESTINATION] => Array ( [0] => Array ( [VALUE] => 55967 ) ) [POUNDS] => Array ( [0] => Array ( [VALUE] => 0 ) ) [OUNCES] => Array ( [0] => Array ( [VALUE] => 9 ) ) [CONTAINER] => Array ( [0] => Array ( [VALUE] => Flat Rate Box ) ) [SIZE] => Array ( [0] => Array ( [VALUE] => REGULAR ) ) [ZONE] => Array ( [0] => Array ( [VALUE] => 6 ) ) [POSTAGE] => Array ( [0] => Array ( [MAILSERVICE] => Array ( [0] => Array ( [VALUE] => Priority Mail® Medium Flat Rate Box ) ) [RATE] => Array ( [0] => Array ( [VALUE] => 11.35 ) ) ) ) ) ) ) ) Array ( [0] => price Object ( [mailservice] => Priority Mail® Medium Flat Rate Box [rate] => 11.35 ) )

Which looks confusing and I have no idea how to get to the rate value at the end there.

Can I get anyhelp in navigating this maze of arrays?

I don’t have code for this, but look up multi-demensional arrays. You’ll need more than one foreach loop to sort through all of those though.

Sponsor our Newsletter | Privacy Policy | Terms of Service