PHPize Online / SQLize Online

Donate Popular

reset

Tags: PHP 5.x PHP 7.x PHP 8.x

reset — Set the internal pointer of an array to its first element.

Description

reset(
    array|object &$array
): mixed
reset() rewinds array's internal pointer to the first element and returns the value of the first array element.

Parameters

array
The input array.

Return Values

Returns the value of the first array element, or false if the array is empty.