(PHP 5 >= 5.0.0, PHP 7)
Return current array key
public mixed ArrayIterator::key ( void )
This function returns the current array key
Returns:
The current array key.
Examples:
ArrayIterator::key() example
<?php
$array = array('key' => 'value');
$arrayobject = new ArrayObject($array);
$iterator = $arrayobject->getIterator();
echo $iterator->key(); //key
?>
Please login to continue.