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
We can do $first = reset($array);
$first = reset($array);
Instead of
reset($array); $first = current($array);
As reset()
reset()
returns the first element of the array after reset;