About current () functions:
Each array has an internal pointer pointing to its "current" unit, initially pointing to the first unit inserted into the array. Use current.
Similar functions:
End () moves the internal pointer of array to the last unit and returns its value.
Next () returns the value of the next unit pointed to by the internal pointer of the array, or FALSE if no more units exist.
Prev () returns the value of the previous Unit pointed to by the internal pointer of the array, or FALSE if there are no more units.
Reset () returns the internal pointer of array to the first unit and the value of the first array unit. If the array is null, FALSE is returned.
See the following PHP case:
Copy codeThe Code is 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 it is php again
Echo end ($ arr); // c
?>
Several useful and useful php functions I remember.