php how to get values from a var problem?
<p>I have a small PHP script that takes the values from a dropdown list and attaches some other strings to them:</p>

<pre><code>$options = array(
    '1' =&gt; 'Backgammon',
    '2' =&gt; 'Chess',
);
$value = $_POST['gamelist'];
echo $options[$value];
</code></pre>

<p>What if I want to grab the values from a variable instead of a dropdown list? How do I do that? My var is:</p>

<pre><code>$defences_results = $game_set-&gt;get_my_defences();
foreach( $defences_results as $key =&gt; $value) {
    print '&lt;li&gt;'.$value['stake'].' &lt;/li&gt;
}
</code></pre>

<p>The print displays <code>1</code>, <code>2</code>, etc. I want to replace that with: <code>Backgammon</code>, <code>Chess</code>, etc.
What I was doing is using <code>.$options[$value].</code></p>

<p>Any ideas?</p>
