Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP key() Function

PHP key() Function

PHP Array ReferenceComplete PHP Array Reference Manual

Example

Return the element key from the current internal pointer position:

Run Example »


Definition and Usage

The key() function returns the element key from the current internal pointer position.

Returns FALSE on error.


Syntax

key(

array

)

Parameters Description
array Required. Specifies the array to use.

Technical Details

Return Value: Returns the key of the array element pointed to by the current internal pointer.
PHP Version: 4+

PHP Array ReferenceComplete PHP Array Reference Manual