- reset: documentation ( source)
<?php
$fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry');
reset($fruit);
while (list($key, $val) = each($fruit)) {
echo "$key => $val\n";
}
echo '-----------------',PHP_EOL;
foreach( $fruit as $key => $val ) {
echo "$key => $val\n";
}