About the current () function:
Each array has an internal pointer to its "current" cell, which initially points to the first cell inserted into the array. Gets with current ().
Similar functions:
End () Moves the internal pointer of the array to the last cell and returns its value.
Next () returns the value of the next cell that the array's internal pointer points to, or false when there are no more cells.
Prev () returns the value of the previous cell pointed to by an array's internal pointer, or FALSE if there are no more cells.
Reset () returns the array's internal pointer back to the first cell and returns the value of the first array cell, False if the array is empty.
Look at the following PHP case:
Copy Code code as follows:
<?php
$arr = Array ("A" => "PHP", "Java", "C");
Echo current ($arr); Php
Echo Next ($arr); Java
Echo prev ($arr); PHP points to the value of the previous unit, so PHP is also
Echo End ($arr); C
?>
Very handy and very useful PHP functions, anyway, I remember.