PHP next() Function

The next() function moves the internal pointer to, and outputs, the next element in the array. next() behaves like current(), with one difference. It advances the internal array pointer one place forward before returning the element value. That means it returns the next array value and advances the internal array pointer by one.

Example -

Example -