Home  >  Article  >  Backend Development  >  How to use next function

How to use next function

藏色散人
藏色散人Original
2019-02-12 10:07:445217browse

PHP next() function is used to move the internal pointer in the array forward one bit.

How to use next function

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn