array_key_first


array_key_first ( $arr )

Parameters:
  • (array) arr An array.
Returns:
  • (string|int|null) The first key of array if the array is not empty; `null` otherwise.
Defined at:

Description

Polyfill for array_key_first() function added in PHP 7.3.Get the first key of the given array without affecting the internal array pointer.

Related Functions

array_key_last, _wp_array_get, _wp_array_set, registered_meta_key_exists, category_exists

Top Google Results

User discussions

wpseek mobile