Menu Home

array_key_first

osbo.com | PHP | Functions | array_key_first

Gets the first key of an array

Syntax

array_key_first ( array $array ) : mixed

Parameters

array

An array.

Return

Returns the first key of array if the array is not empty; NULL otherwise.

Examples

string(1) "a"

PHP