- current: documentation ( source)
- rewind: documentation ( source)
<?php
$a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
rewind($a);
foreach ($a as $v) {
echo('Array points to: ' . current($a) . ' foreach() is at element: ' . $v . PHP_EOL);
}
echo('After loop array points to: ' . current($a));