array_first


array_first ( $array )

Parameters:
  • (array) array The array to get the first element from.
Returns:
  • (mixed|null) The first element of the array, or null if the array is empty.
Defined at:

Description

Polyfill for `array_first()` function added in PHP 8.5.Returns the first element of an array.

Related Functions

array_find, array_last, array_is_list, _wp_array_set, array_find_key

Top Google Results

User discussions

wpseek mobile