<html lang="en">
<head>
<meta charset="utf-8">
<title>Get the Last Key of an Array in PHP</title>
</head>
<body>
<pre>
// Sample array
$persons = array("Harry"=>18, "Clark"=>32, "John"=>24);
// Getting the last key from the persons array
echo array_key_last($persons); // Prints: John
</pre>
</body>
</html>