<?php
$array = array('step one', 'step two', 'step three', 'step four');
// by default, the pointer is on the first element
echo current($array)."<br>\n"; // step "one"
// skip two steps
next($array);
next($array);
echo current($array)."<br>\n"; // "step three"
// reset pointer, start again on step one
reset($array);
echo current($array)."<br>\n"; // "step one"
?> |