The What
Description
The reset
function does two tasks:
- It moves the array’s internal pointer to the first element in the array.
- Then it returns the element’s value at the new position.
If the array is empty, then false is returned.
Parameters
array_variable
- The array to be worked on by
prev
.
Return Values
Returns the value of the first element. If the array is empty, then false is returned.
Show It in ActionBasic
In this video, you will see the reset
function in action through various code examples.
Once upon a time, there was a developer... You! This is going to be a good story...
Go DeepPro
In this video, you will go deeper into the instruction. You will also look at the PHP source code.