Posted by Geoff Berrow on 06/05/05 21:25
I noticed that Message-ID:
<42a33bbd$0$14739$9b4e6d93@newsread4.arcor-online.net> from Matthias
Braun contained the following:
>
>I am using arrays and a while loop for go through all the elements. The
>problem is that the first element is missing:
>
>while ($val = next($array))
>{
> $key = key($array);
>echo "$key: $val\n"
>
>}
That's what foreach is for
foreach ($array as $key => $value) {
echo "Key: $key; Value: $value<br />\n";
}
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
Navigation:
[Reply to this message]
|