PHP reset() Function Guide
In PHP, the reset() function is used to point the internal pointer of an array to the first element and return the value of that element. For example:
$fruits = array("apple", "banana", "cherry");
$first_fruit = reset($fruits); // $first_fruit 现在包含 "apple"
echo $first_fruit; // 输出 "apple"
In the above example, the reset() function resets the internal pointer of the $fruits array to the first element, then returns the value “apple” of that element and assigns it to the $first_fruit variable.