php8.5
Home/ Manual/ spl / iteratoriterator/ IteratorIterator::key

IteratorIterator::key

PHP function Edit on GitHub ✎

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

Get the key of the current element

Description

IteratorIterator::key(): mixed

Get the key of the current element.

Parameters Parameters

Return Values

The key of the current element.

See Also

  • IteratorIterator::current

Source: reference/spl/iteratoriterator/key.xml · from the official PHP manual (php/doc-en)