PHP Treat String as Variable
<p>I have a piece of code here that does not work despite me using a $$ on it to treat the string as a variable:</p>

<pre><code>&lt;? foreach (KOHANA::config('list.amenities_forms') as $k =&gt; $v) : ?&gt;
        &lt;div class="form"&gt;
            &lt;fieldset&gt;
                &lt;legend&gt;&lt;?php echo $v ?&gt;&lt;/legend&gt;
                &lt;input type="checkbox" name="&lt;?=$k?&gt;flag" id="&lt;?=$k?&gt;flag"/&gt;
                &lt;label class="inline"&gt;&lt;?=$v?&gt;&lt;/label&gt;

                &lt;label&gt;Description&lt;/label&gt;
                &lt;textarea cols="50" rows="5" name="&lt;?=$k?&gt;[]"&gt;&lt;?= empty($$k[0]) ? '' : $$k[0]?&gt;&lt;/textarea&gt;

                &lt;label&gt;Size&lt;/label&gt;
                &lt;input type="text" name="&lt;?=$k?&gt;[]" value="&lt;?= empty($$k[1]) ? '' : $$k[1]?&gt;"/&gt;

                &lt;label&gt;Capacity&lt;/label&gt;
                &lt;input type="text" name="&lt;?=$k?&gt;[]" value="&lt;?= empty($$k[2]) ? '' : $$k[2]?&gt;"/&gt;
            &lt;/fieldset&gt;
        &lt;/div&gt;
    &lt;? endforeach?&gt;
</code></pre>

<p>the function Kohana::config returns this array:</p>

<pre><code>'amenities_forms' =&gt; array(
        'meeting_space' =&gt; 'Meeting Space',
        'breakfast_room' =&gt; 'Breakfast Room',
        'living_quarters' =&gt; 'Living Quarters',
        'restaurant' =&gt; 'Restaurant',
        'bar' =&gt; 'Bar'
    )
</code></pre>

<p>what could I be doing wrong?</p>
