Re: Using Arrays in PHP here we can discuss briefly one by one about ArrayIterator... ArrayIterator::current
ArrayIterator::current -- Return current array entry
Description
mixed ArrayIterator::current ( void )
This function returns the current array entry Example: ArrayIterator::current() <?php
$array = array('1' => 'one',
'2' => 'two',
'3' => 'three');
$arrayobject = new ArrayObject($array);
for($iterator = $arrayobject->getIterator();
$iterator->valid();
$iterator->next()) {
echo $iterator->key() . ' => ' . $iterator->current() . "\n";
}
?>
The above example will output:
1 => one
2 => two
3 => three
__________________ Thanks & Regards
Sabari...
Last edited by Sabari : 08-21-2007 at 10:52 PM.
|