reset
Set the internal pointer of an array to its first element
&reftitle.description;
mixedreset
arrayarray
reset rewinds array's internal
pointer to the first element and returns the value of the first array
element.
&reftitle.parameters;
array
The input array.
&reftitle.returnvalues;
Returns the value of the first array element, or &false; if the array is
empty.
&return.falseproblem;
&reftitle.examples;
reset example
\n"; // "step one"
// skip two steps
next($array);
next($array);
echo current($array) . "
\n"; // "step three"
// reset pointer, start again on step one
reset($array);
echo current($array) . "
\n"; // "step one"
?>
]]>
&reftitle.notes;
The return value for an empty array is indistinguishable from
the return value in case of an array which has a boolean &false;
first element. To properly check the value of the first element of an array
which may contain &false; elements, first check the count
of the array, or check that key is not
&null;, after calling reset.
&reftitle.seealso;
current
each
end
next
prev
array_key_first