Re: help with arrays
| From: | Eugene Lee | Date: | Tue, 23 Sep 2003 21:54:17 +0000 |
| Subject: | Re: help with arrays | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-163645@lists.php.net to get a copy of this message | ||
On Tue, Sep 23, 2003 at 05:44:46PM -0400, Robert Cummings wrote:
: On Tue, 2003-09-23 at 17:37, Eugene Lee wrote:
: > On Tue, Sep 23, 2003 at 01:49:03PM -0700, Chris W. Parker wrote:
: > :
: > : Robert Cummings <mailto:robert@interjinn.com> said:
: > : >
: > : > foreach( $data as $key => $value )
: > :
: > : I don't use that syntax much so I'm not familiar with it. Maybe I should
: > : start eh?
: >
: > Another caveat: it works on a *copy* of the array. This is fine for
: > small arrays, but may be a performance killer for larger arrays.
:
: I don't think you have enough knowledge of the PHP internals to make
: that claim :)
You're right. I know little of PHP internals. I'm just going by what
little the official documentation tells me. :-)
http://www.php.net/manual/en/control-structures.foreach.php
Note: Also note that foreach operates on a copy of the specified
array and not the array itself.