Re: Shorter way for "each"
| From: | Chris Lee | Date: | Wed, 10 Jan 2001 16:24:18 +0000 |
| Subject: | Re: Shorter way for "each" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33692@lists.php.net to get a copy of this message | ||
everyone allready posted about foreach(), but they didnt post the
alternative syntax
foreach ($array as $position => $value)
{
echo $postition : $value<br>\n";
}
http://www.php.net/manual/control-structures.foreach.php
Chris Lee
Mediawaveonline.com
""Moritz Petersen"" <lists@jface.de> wrote in message
news:IDEGIIJAKDOBOAJGJCCCCEKKCDAA.lists@jface.de...
> Hi,
>
> is there a shorter way to do:
>
> while (list($key, $value) = each($my_array))
> {
> echo $value...
> }
>
> I just need the value!
>
> Thanks,
> Mo.
>
> --
> 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
>