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
Hands off the keyboard. Web development starts by thinking first, then planning it out, and then coding it.
The following PHP constructs were mentioned in the code examples: