Re: learning php - problem already

From: Date: Wed, 30 Jul 2003 07:51:33 +0000
Subject: Re: learning php - problem already
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-157500@lists.php.net to get a copy of this message
"Curt Zirzow" <curt@zirzow.dyndns.org> wrote in message news:20030729221645.GN10509@bagend.shire... > * Thus wrote John W. Holmes (holmes072000@charter.net): > > [snip] > don't but all that matters to most is: it works.. and foreach has > taken over its job anyway. Just a small comment... foreach() is not equal to a while/each loop. Foreach uses a copy of the array, and not the array itself. This might not sound important, but it was for me when I tried to add new elements to the array in the middle of a foreach() loop. They didn't show up until after the loop, which was a bit confusing for me at first. So occasionally when I need to add elements during a loop, I still use while(list(..) = each(...)). -- Ivo

« previous php.general (#157500) next »