array_shift() removes and returns the first element of an array passed to it as an argument.
$an_array = array("a", "b", "c");
while ( count( $an_array ) ) {
$val = array_shift( $an_array);
print "$val
";
print "there are ".count( $an_array )." elements in \$an_array
";
}
?>