Within PHP, an array has an internal pointer, which provides a mechanism for other functions to interact and traverse (move) through the array. This internal pointer points to its “current” element. When an array is first initialized (created), the internal pointer is set to the first element of the array.
current function fetches the “current” element, i.e. the one that the internal pointer is pointing at within the array.
- The array to be worked on.
Returns the value of the current element.
Show It in ActionBasic
Don’t repeat yourself. Don’t repeat yourself. Don’t repeat yourself.
The following PHP constructs were mentioned in the code examples: