Re: Question on foreach()?
| From: | Joey Smith | Date: | Fri, 14 Jul 2000 15:52:16 +0000 |
| Subject: | Re: Question on foreach()? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-24543@lists.php.net to get a copy of this message | ||
I should have been more clear, I guess.
I am fully aware of the
foreach($array as $key => $value)
structure. What I am asking is WHY the shorter version deals with
values instead of keys. This was more a ? for one of the core guys, trying
to understand conceptually WHY something was done.
On Fri, 14 Jul 2000, Chuck Hagenbuch wrote the following to waldschrott :
> Quoting waldschrott <waldschrott@kiffen.de>:
>
> > Would be nice if we had
> > foreach($array key $key)
> > or something like this,
> > foreach($array => $key) would not make sense...
>
> Uh... http://www.php.net/manual/control-structures.foreach.php:
>
> foreach(array_expression as $key => $value)
>
> -chuck
>
> --
> Charles Hagenbuch, <chagenbu@wso.williams.edu>
> --
> " ... I mean, who wouldn't look forward to waking up in the morning and
> having a nice big bowl of frosted For-Next Loops ... " - Slashdot comment
>