Returns the current element.
Arrays have an internal pointer that keeps track of the "current" element. This function returns that element.
<?php
$array1 = array("one", "two", "three");
while ($element = current($array1)) {
print "$element ";
next($array1);
}
?>
one two three
The code uses the current() and next() functions to print all the elements in an array.