|
|
PHP Array Element Reset Function
|
Tutorials » Php »
|
Topic |
What is reset() Function?
|
|
Explanation |
|
The "reset()" function sets the internal pointer of an array to its first element.
Syntax:
reset(array)
In the above syntax "array" is the array in which the internal pointer is set to the first element.
Example
<?php
$b=array("Grapes","Apple","Cherry");
echo current($b).">br /<";
echo next($b).">br /<";
echo reset($b).">br /<";
?>
Result:
Grapes.
Apple.
Grapes.
In the above example the array "$b" first the current value, then the next value and the resetted
value is displayed.
|
|
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.
|
|
|
|