first item in array php
snippet in php

php get first element of array

user199

$colors = array(2=>"blue",3 =>"green",1=>"red");
$firstValue = reset($colors); //blue
$firstKey = key($colors); //2

first item in array php

user7581

$firstItem = array_shift($array);