Hi,
I am getting two different results as given below for the same code, Just by changing a third element in the array. Same thing is given in the "Professional PHP Programming Book". Anybody have the reason for this...?
$arr = array (3,2,6,9,4,6);
do{
$k = key ($arr);
$val = current ($arr);
echo ("Element $k equals $val <br> ");
} while (next($arr));
gives the following output:
Element 0 equals 3
Element 1 equals 2
Element 2 equals 6
Element 3 equals 9
Element 4 equals 4
Element 5 equals 6
By changing the array as (3,2,0,9,4,6);
For the same code the output looks like this:
Element 0 equals 3
Element 1 equals 2
Thanks.
Prasanth Bojja.