get first element of array in core php code example
Example 1: get first key of array php
$firstKey = array_key_first($array);
Example 2: php array get first x elements
$sliced_array = array_slice($array, 0, 5)
$firstKey = array_key_first($array);
$sliced_array = array_slice($array, 0, 5)