On 11/10/06, R. Mariotti <[EMAIL PROTECTED]> wrote:
> here's what the array looks like:
>
> $agx=array( 'back_door' => '0',
>         'front_door' => '1',
>         'side_door'  => '0',
>         'garage_door' => '1'
> );
>
> I have tried various permutations of the while(list($k,$v... and
> foreach($atx as $v => $k)

for your array $atx,

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.

Since you "don't know the current values of the keys", are you sure
that the keys of the $atx array are set as you suspect? Try a
print_r($atx) and see what you are starting with.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to