Home >Backend Development >PHP Tutorial >How to use next function
PHP next() function is used to move the internal pointer in the array forward one bit.
php next() function Syntax
Function: Point the internal pointer to the next element in the array and output it.
Syntax:
next(array)
Parameters:
array Required. Specifies the array to use.
Description: Move the internal pointer forward one bit before returning the value. This means that it returns the value of the next array element and moves the array pointer forward one position. If the result of moving the pointer is beyond the end of the array element, next() returns FALSE.
php next() function example 1
<?php $people = array("西门", "灭绝", "无忌"); echo next($people); ?>
Output:
灭绝
php next() function example 2
<?php $arr = array("灭绝", "欧阳克", "peter"); echo next($arr); ?>
Output:
欧阳克
This article is an introduction to the PHP next function. I hope it will be helpful to friends in need!
The above is the detailed content of How to use next function. For more information, please follow other related articles on the PHP Chinese website!