英[?ri:?set] 美[ri?s?t]
vt.Reset; rearrange; reinstall
n.Replace; replay something
vi.Reset; clear
Third person singular: resets Present participle: resetting Past tense: reset Past participle: reset
php reset() function syntax
Function: Point the internal pointer to the first element in the array and output it.
Syntax: reset(array)
Parameters:
Parameter | Description |
array | Required. Specifies the array to use. |
Description: If successful, return the value of the first element in the array, if the array is empty, return FALSE.
php reset() function example
<?php $people = array("西門", "滅絕", "無忌"); echo end($people); //指向最后一個(gè)元素 無忌 echo "<br>"; echo reset($people); //指向數(shù)組中第一個(gè)元素 西門 ?>
Run instance?
Click the "Run instance" button to view the online instance
Output:
無忌 西門
<?php $people = array("歐陽克", "無忌", "Peter_zhu"); echo end($people); //指向最后一個(gè)元素 Peter_zhu echo "<br>"; echo reset($people); //指向數(shù)組中第一個(gè)元素 歐陽克 ?>
Run Instance?
Click the "Run Instance" button to view the online instance
Output:
Peter_zhu 歐陽克