Question: I have this array:

```
$a = array('it' => 'italiano',
                 'fr' => 'francese',
                 'en' => 'inglese',
                 'es' => 'spagnolo',
                 'de' => 'deutsch',

               );

```

Is there any function that i give as arguments the array and a key (for example 'en') and it returns 'inglese'?

Regards

Javi

Answer: 
```
$languageName = 'Default';
$languageCode = 'en';
if (isset($a[$languageCode])) {
   $languageName = $a[$languageCode];
}

```
What's wrong with using `$a['en']`? Which would give 'inglese' as well.

```
function get_value($array, $key){
  return (isset($array[$key]) ? $array[$key] : null;
}

echo get_value($array, 'en'); # => echoes inglese

```