array_key_last
PHP function
Edit on GitHub ✎
(PHP 7 >= 7.3.0, PHP 8)
Gets the last key of an array
Description
array_key_last(array $array): int|string|null
Get the last key of the given array without affecting the internal array pointer.
Parameters
arrayAn array.
Return Values
Returns the last key of array if the array is not empty; null otherwise.