Re: Looping through arrays with foreach



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.

.



Relevant Pages

  • Re: Looking for some help....
    ... Sjoerd wrote: ... A diagonal line is hard to do in HTML. ... If you're proposing to use PHP anyway, look at the various graphics libraries available in PHP, and generate the item as a PNG. ...
    (comp.lang.php)
  • Re: Looking for some help....
    ... Sjoerd wrote: ... A diagonal line is hard to do in HTML. ... If you're proposing to use PHP anyway, look at the various graphics libraries available in PHP, and generate the item as a PNG. ...
    (comp.lang.php)
  • Re: Binary Content from Image Resource
    ... i saw that on the php pages but i didnt really get that it was a ... workaround for what i want, Thanks Sjoerd ...
    (comp.lang.php)