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
I do this to get the first and last value. This works with more values too.
$a = array( 'foo' => 400, 'bar' => 'xyz', ); $first = current($a); //400 $last = end($a); //xyz