Re: Shorter way for "each"
| From: | Alexander Wagner | Date: | Wed, 10 Jan 2001 15:17:29 +0000 |
| Subject: | Re: Shorter way for "each" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33672@lists.php.net to get a copy of this message | ||
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