PHP key() Function
Complete 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+ |
Complete PHP Array Reference Manual