get first item code example
Example 1: php get first element of array
$colors = array(2=>"blue",3 =>"green",1=>"red");
$firstValue = reset($colors); //blue
$firstKey = key($colors); //2
Example 2: how to find first value of an list
// Python
list = [1,2,3]
firstdigit = list[0] // 1
list = ['Hello', 'bye', 'Adios']
firstvalue = list[0] // 'Hello'