View Single Post
  #13 (permalink)  
Old 08-16-2007, 04:02 AM
Sabari Sabari is offline
D-Web Genius
 
Join Date: Jul 2007
Posts: 1,008
Sabari is on a distinguished road
Default 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.
Reply With Quote