Start PHP Code RESULT
a
There are 6 elements in $an_array
b
There are 5 elements in $an_array
c
There are 4 elements in $an_array
d
There are 3 elements in $an_array
e
There are 2 elements in $an_array
f
There are 1 elements in $an_array
g
There are 0 elements in $an_array
End PHP Code RESULT
The PHP Code START
$an_array= array("a","b","c","d","e","f","g");

while ( count ($an_array )) {
    $val = array_shift( $an_array );
    print "$val<br />";
    print "There are ".count( $an_array )." elements in \$an_array <br />";
}
The PHP Code END