Posted by Chung Leong on 03/31/06 16:44
Sjoerd wrote:
> Another method to loop through an array is the following:
> <?php
> while (list(, $value) = each($arr)) {
> echo "Value: $value<br />\n";
> }
> ?>
The main problem with the list() = each() construct is that it has a
side-effect--namely that of advancing the array's internal pointer.
Forgetting to call reset() on an array was a common mistake in PHP 3.
[Back to original message]
|