September 2001
Intermediate to advanced
768 pages
32h 45m
English
mixed reset(array array) Moves the internal array pointer to the first element of the array and returns that element’s value.
Returns:
Value of the first element of the array; FALSE if there is no first element
Description:
This function resets the internal array pointer to the first element of array and returns the value of that element. The order in which PHP keeps the array is the same order in which the elements were put into the array by the use of any of the element-addition functions such as array(), push(), and so on.
Version:
PHP 3, PHP 4
See also:
end() key() current() next() prev()
Example:
$my_array = array('a', 'b', 'c', 'd', 'e'); echo current($my_array); for ($i = count($my_array); $i ... |
Read now
Unlock full access