<?php
$arr = array('mango',
'banana',
'apple',
'rambutan',
'pineaple',
'strawbery');
$iterator = new ArrayIterator($arr);
$iterator->rewind();
while($iterator->valid()){
echo $iterator->key() . " : " . $iterator->current() . " <br>";
$iterator->next();
}
?>
Back to TOC Array Tips