The reset function points the array's internal pointer to the first cell and outputs the array.
Basic syntax
Reset (Array)
Reset () pours the array's internal pointer back into the first cell and returns the value of the first array cell.
Parameter introduction:
| Parameters |
Description |
| Array |
Necessary. Specify the array to use. |
return value
Returns the value of the first cell in the array, or FALSE if the array is empty.
Instance
<?php
$array = Array (' Step one ', ' Step two ', ' Step three ', ' step Four ');
The array default pointer points to the first element
, Echo current ($array). <br/> ";
Point the pointer to the next element next
($array);
Next ($array);
Echo current ($array). <br/> ";
Point the pointer again to the first element
reset ($array);
Echo current ($array). <br/> ";
? >
Run Result:
Step One
Step Three
Step One
Thank you for reading, I hope to help you, thank you for your support for this site!