first el from array php code example
Example 1: get first element of array php
array_values($array)[0];
Example 2: php array get first x elements
$sliced_array = array_slice($array, 0, 5)
array_values($array)[0];
$sliced_array = array_slice($array, 0, 5)