Let S be an associative array in PHP, I need to retrieve and extract from it the first element, both the value and the key.
I would use
value1=array_pop
$value = reset($array); $key = key($array);
Edit: Hakre just beat me to it :-)