php next() function


  Translation results:

英[nekst] 美[nɛkst]

adj. Immediately behind; second to; close to; immediately adjacent

adv. to follow; then; behind ;sequential

n.next;next one

prep.near;behind;next door to…

php next() functionsyntax

Function: Point the internal pointer to the next element in the array and output it.

Syntax: next(array)

Parameters:

Parameter Description
arrayRequired. Specifies the array to use.

Description: Move the internal pointer forward one position 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() functionexample

<?php
$people = array("西门", "灭绝", "无忌");
echo next($people);
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

灭绝


<?php
$arr = array("灭绝", "欧阳克", "peter");
echo next($arr);
?>

Run Instance»

Click the "Run Instance" button to view the online instance

Output:

欧阳克

Popular Recommendations

Home

Videos

Q&A