Home Menu

array_key_last

Gets the last key of an array

Syntax

array_key_last ( array $array ) : mixed

Parameters

array

An array.

Return

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

Examples

<?

$array = array("a" => 0, "b" => 1, "c" => 2);

$return = array_key_last($array);

var_dump($return);

?>
string(1) "c"

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms