Output data from an associative array
<p>I've stored countries with their codes in an array like below</p>

<pre><code>$countries = array (
    'AF' =&gt; 'Afghanistan',
    'AX' =&gt; 'Åland Islands',
    'AL' =&gt; 'Albania',
    'DZ' =&gt; 'Algeria'
);
</code></pre>

<p>Suppose I got the country code 'AF' or country name 'Afghanistan' from a form, how do I output both the code and name from the array?</p>

<p>The output I'm trying to get is: Afghanistan AF. I'll later use that in code below.</p>

<pre><code>echo $countries['AF'] gives me the country name, but how do I output both;
</code></pre>
