|
|
PHP Array next() Function
|
Tutorials » Php »
|
Topic |
What is next() Function?
|
|
Explanation |
|
The "next()" function advances the internal array pointer of an array.
Syntax:
next(array)
In the above syntax "array" is the array in which the internal pointer is to be advanced.
Example
<?php
$b=array("Grapes","Apple","Cherry");
echo current($b)."<br/>";
echo next($b)
?>
Result:
Grapes
Apple
In the above example from the array "$b" current element is displayed, then the pointer is moved using the next() to
display "Apple".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|