array_key_last

(PHP 7 >= 7.3.0, PHP 8)

array_key_lastGets the last key of an array

Descrizione

array_key_last(array $array): int|string|null

Get the last key of the given array without affecting the internal array pointer.

Elenco dei parametri

array

An array.

Valori restituiti

Returns the last key of array if the array is not empty; null otherwise.

Vedere anche:

  • array_key_first() - Gets the first key of an array
  • end() - Sposta il puntatore interno dell'array all'ultimo elemento