The current pointer, which outputs the element it points to, and next indicates that the pointer moves to the next element; The prev pointer moves to the previous element; End indicates that the pointer moves to the last element; reset indicates that the pointer moves to the first element;
<?php$people = Array ("Bill", "Steve", "Mark", "David"), Echo current ($people). "<br>"; The current element is Billecho next ($people). "<br>"; The next element of Bill is Steveecho current ($people). "<br>"; Now the current element is Steveecho prev ($people). "<br>"; The last element of Steve is Billecho end ($people). "<br>"; The last element is Davidecho prev ($people). "<br>"; The element before David is Markecho current ($people). "<br>"; Currently the current element is Markecho Reset ($people). "<br>"; Move the internal pointer to the first element of the array, Billecho next ($people). "<br>"; Bill's next element is Steveprint_r (each ($people)); Returns the key name and key value of the current element (currently Steve) and moves the inner pointer forward?>
Array pointer manipulation in PHP