Another way to get first array key with PHP older than 7.3.
<?php
$array = ['one', 'two', 'three'];
$array2 = ['one' => 'Number one', 'two' => 'Number two'];
reset($array);// go to first array
echo key($array);// get its key (first array)
// expect 0.
reset($array2);
echo key($array2);
// expect one.