How to get the first element key in a array PHP
To get the first element key in a array we need to use the built-in array_key_first()
function in PHP.
Here is an example:
$arr = array("lion", "tiger", "cat");
echo array_key_first($arr); // 0
array_key_first(): Get the first key of the given array without affecting the internal array pointer.