If I had an array like:
$array[\'foo\'] = 400; $array[\'bar\'] = \'xyz\';
And I wanted to get the first item out of that array without knowing
You can try this.
To get first value of the array :-
'bar', 'hello' => 'world'); var_dump(current($large_array)); ?>
To get the first key of the array
'bar', 'hello' => 'world'); $large_array_keys = array_keys($large_array); var_dump(array_shift($large_array_keys)); ?>