PHP if else statements
<p>We have variable <code>$country</code>, it can give ~50 different values.</p>

<p>And variable <code>$id</code>.</p>

<p>What we should do is to give a value for <code>$id</code> corresponding to <code>$country</code> value, like:</p>

<pre><code>if ($country = 'USA') { $id = 'usa_type'; }
else if ($country = 'France') { $id = 'france_type'; }
else if ($country = 'German') { $id = 'german_type'; }
else if ($country = 'Spain') { $id = 'spain_type'; }
...
...
...
else if ($country = 'Urugway') { $id = 'urugway_type'; }
else { $id = 'undefined'; }
</code></pre>

<p><code>else if</code> statement repeats everytime, and other data is typical. </p>

<p>Is there a way to make this code shorter? </p>

<p>Like:</p>

<pre><code>[france]:'france_type;
[england]:'england_type;
...
[else]:'undefined'
</code></pre>

<p>Thanks.</p>
