9951 explained code solutions for 126 technologies


phpGet first element of an associative array


list($key, $value) = [array_key_first($arr), $arr[array_key_first($arr)]];ctrl + c
$key

will contain first element key

$value

will contain first element value

$arr

array to get first element of

array_key_first

returns first key of an associative array