RE: [PHP] Shorter way for "each"

From: Date: Wed, 10 Jan 2001 15:32:30 +0000
Subject: RE: [PHP] Shorter way for "each"
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33674@lists.php.net to get a copy of this message
That's it. Thank you! > -----Original Message----- > From: Alexander Wagner [mailto:wagner@globalpark.de] > Sent: Wednesday, January 10, 2001 4:17 PM > To: Php-General@Lists. Php. Net > Subject: Re: [PHP] Shorter way for "each" > > > Moritz Petersen wrote: > > is there a shorter way to do: > > > > while (list($key, $value) = each($my_array)) > > { > > echo $value... > > } > > > > I just need the value! > > PHP3: > while (list(, $value) = each($my_array)) > { > echo $value... > } > > PHP4: > foreach ($my_array as $value) > { > echo $value... > } > > manual/control-structures.foreach.php > > Wagner > > -- > One maniac alone can do what 20 together cannot > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#33674) next »