Array Functions
PHP Manual

reset

(PHP 4, PHP 5)

resetاشاره‌گر داخلی یک آرایه را به اولین عضو آن قرار بده

Description

mixed reset ( array &$array )

reset() اشاره‌گر داخلی array را به اولین عضو آرایه بازمی‌گرداند.

Parameters

array

آرایه ورودی.

Return Values

مقدار اولین عضو آرایه را بازمی‌گرداند و یا FALSE اگر آرایه خالی باشد.

Examples

Example #1 مثال reset()

<?php

$array 
= array('step one''step two''step three''step four');

// by default, the pointer is on the first element
echo current($array) . "<br />\n"// "step one"

// skip two steps
next($array);
next($array);
echo 
current($array) . "<br />\n"// "step three"

// reset pointer, start again on step one
reset($array);
echo 
current($array) . "<br />\n"// "step one"

?>

See Also


Array Functions
PHP Manual