Blog de programación, errores, soluciones

Chose Language:
Author: Admin/Publisher |finished | checked

PHP array_key_last function

It retrieves the last key of the array without affecting the pointer’s position within the array.

Description / Descripción
array_key_last(array $array): int|string|null


$array – the array from which we will get the last key.


Returns the last key of the array if the array is not empty; otherwise, it will return null.


In this case, we’ll use the same example we saw with array_key_first, but we’ll use array_key_last to find the key of the last element.

$marcasDeAutos = array(

Category: en-php
Something wrong? If you found an error or mistake in the content you can contact me on Twitter | @luisg2249_luis.
Last 4 post in same category