NYCPHP Meetup

NYPHP.org

[nycphp-talk] Please assist w/simple associative array, problem?

Bob Mariotti r.mariotti at fdcx.net
Sat Nov 11 08:42:01 EST 2006


>
> foreach ($agx as $key => $value) {
> 	echo "$key is set to $value\n";
> }
>
> will give you the output:
>
> back_door is set to 0
> front_door is set to 1
> side_door is set to 0
> garage_door is set to 1
>
> Note that in your example foreach $v is in the key position & $k is in
> the value, but that's probably a typo in your email & not your code.
Thanks Jeff (and the others)...

I believe the above is what I needed.  Regarding whether or not the 
array actually contains what I expected... YES - I used print_r to 
verify and it does.

Sometimes is the seemingly simple stuff that gets the most confusing.

bobmct



More information about the talk mailing list