【reset】返回数组的第一个元素值,并把数组内部指针指向这个元素
reset ( array &$array ) : mixed
- 如果数组是空数组,函数返回 false。
<?php
$array = array('step one', 'step two', 'step three', 'step four');
echo current($array) . "\n";
next($array);
next($array);
echo current($array) . "\n";
reset($array);
echo current($array) . "\n";
/*
step one
step three
step one
*/