PHP Array next() Function
Last Updated : 17 Mar 2025
The PHP next( ) function is used to advance the internal array pointer. It advances the internal array pointer one place forward before returning the element value. This function was introduced in PHP 4.0.
Syntax
Parameter
| Parameter | Description | Is compulsory |
|---|---|---|
| array | Specifies the array to use. | compulsory |
Returns
The PHP next( ) function returns the value of the next element in the array on success or false if there are no more elements.
Example 1
Output:
T
Example 2
Output:
java c
Example 3
Output:
java c os
Example 4
Output:
youtube fb youtube fb
Next TopicPhp-array-pad-function