9951 explained code solutions for 126 technologies


phpGet first element of an array


$element = array_shift(array_values($arr));ctrl + c
$element

variable will contain first $arr element value

array_shift

takes first element out of array

array_values

returns only array values (in case array is associative)

$arr

array to get first element of