- key: documentation ( source)
- next: documentation ( source)
- current: documentation ( source)
<?php
$a = array('leg1'=>'LA', 'leg2'=>'NY', 'leg3'=>'NY', 'leg4'=>'FL');
while($current = current($a)) {
echo key($a) . ":" . $current; // leg2:NY
$next = next($a);
echo key($a) . ":" . $next; // leg3:NY
$nextnext = next($a);
echo key($a) . ":" . $nextnext; // leg4:FL
next($a);
}