PHP next() Function

PHP next() Function

The next() function in PHP advances or moves the internal array pointer one place forward and returns the next array value.

Syntax

next ( array &$array )

Parameter

array(required)- This parameter represents the input array.

Return

This parameter returns the next array value in the place that's pointed to by the internal array pointer, or FALSE if there are no more elements.

Example 1

 

Output

The pointer of the array is at banana

Example 2

 

Output

The pointer of the array is at 

Example 3

 

Output

The pointer of the array is at 'cycle'
The pointer of the array is at 'bike'
The pointer of the array is at 'car'
The pointer of the array is at 'bike'
The pointer of the array is at 'airplane' 

Example 4

 

Output

The pointer of the array is at