Javatpoint Logo
Javatpoint Logo

PHP reset() function

The PHP reset( ) function is used to move the array's internal pointer to the first element. This function was introduced in PHP 4.0.

Syntax

Parameter

Parameter Description Is compulsory
array Specifies the array to use. compulsory

Returns

The reset( ) function returns the value of the first array element or false if the array is empty.

Example 1

Output:

sachin

Example 2

Output:

cat
dog
cat

Example 3

Output:

os
dbms
java

Example 4

Output:

os
dbms
os
java





Help Others, Please Share

facebook twitter pinterest