PHP Array, get the key based on a value
<p>If I have this array</p>

<pre><code>$england = array(
        'AVN' =&gt; 'Avon',
        'BDF' =&gt; 'Bedfordshire',
        'BRK' =&gt; 'Berkshire',
        'BKM' =&gt; 'Buckinghamshire',
        'CAM' =&gt; 'Cambridgeshire',
        'CHS' =&gt; 'Cheshire'
);
</code></pre>

<p>I want to be able to get the three letter code from the full text version, how would i write the following function:</p>

<pre><code>$text_input = 'Cambridgeshire';
function get_area_code($text_input){
    //cross reference array here
    //fish out the KEY, in this case 'CAM'
    return $area_code;
}
</code></pre>

<p>thanks!</p>
