|
Posted by speralta on 02/07/07 17:56
On Feb 7, 9:35 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(spera...@progressivetrail.org)
>
> >The following is the output of a print_r on an array. The value of
> >element[0] is itself an array. How do I access the elements in the
> >second array?
>
> $foo[1st level][2nd level][3rd level]
>
> Micha
Hi Micha,
Thanks for the suggestion, It was the step in the right direction that
I needed to resolve the problem. The problem was that I was trying to
access the elements in the associative array by index numbers rather
than as a key/value pair. This worked:
foreach($city[0] as $key => $value) {
echo $key.'='.$value;
}
How do I get, in this example, the value of the array element with the
key "vancouver":
Array ( [0] => Array ( [Vancouver] => Vancouver [Eugene] => Eugene
[Beaverton] => Beaverton ) )
Navigation:
[Reply to this message]
|