JavaScript Editor Javascript debugger      Website design 

ArrayIterator::key

Return current array key ()
mixed ArrayIterator::key ( )

This function returns the current array key

Example 2306. ArrayIterator::key() example

<?php
$array
= array('key' => 'value');

$arrayobject = new ArrayObject($array);
$iterator = $arrayobject->getIterator();

echo
$iterator->key(); //key
?>