English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The reset() function points the internal pointer of the array to the first element
reset(array $array);
The reset() function moves the internal pointer of the array back to the first element and returns the value of the first array element; if the array is empty, it returns FALSE.
Serial Number | Parameters and Description |
---|---|
1 | array(Required) It specifies an array |
Returns the first element of the array.
<?php $input = array('foot', 'bike', 'car', 'plane'); $mode = end($input); print "$mode <br />"; $mode = reset($input); print "$mode <br />"; $mode = current($input); print "$mode <br />"; ?>Test and See‹/›
Output Result
plane foot foot