title: Why I'm not getting array values as options in select control in following scenario?
body: <p>I've an array titled <code>$volume_unit_list</code> as follows:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 5
              [unit] =&gt; Microsecond
              [created_at] =&gt; 1397479783
              [updated_at] =&gt; 1397479783
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 7
              [unit] =&gt; oz
              [created_at] =&gt; 1397548900
              [updated_at] =&gt; 1397672502
          )
  
      [2] =&gt; Array
          (
              [id] =&gt; 9
              [unit] =&gt; ml
              [created_at] =&gt; 1397641838
              [updated_at] =&gt; 1397672480
          )
  
      [3] =&gt; Array
          (
              [id] =&gt; 10
              [unit] =&gt; L
              [created_at] =&gt; 1397672517
              [updated_at] =&gt; 1397672517
          )
  
      [4] =&gt; Array
          (
              [id] =&gt; 12
              [unit] =&gt; gms
              [created_at] =&gt; 1398196412
              [updated_at] =&gt; 1398196412
          )
  
  )
  </code></pre>
  
  <p>The select code to display the array values is as follows:</p>
  
  <pre><code>echo "&lt;tr id='reb$rebate_no'&gt;
          &lt;td&gt;
             &lt;input type='text' name='pack[]' value='' class='form-control' size='8'/&gt;
          &lt;td&gt;
          &lt;div class='btn-group'&gt;
          &lt;select id='unit' name='units[]' class='form-control'&gt;
             &lt;option value=''  if $data.id=='' selected='selected'{/if}&gt;Select Unit&lt;/option&gt;
             foreach ($volume_unit_list as $key=&gt;$value)
               &lt;option value=$key[id]&gt;$key[unit]&lt;/option&gt;
          &lt;/select&gt;
          &lt;/div&gt;
          &lt;/td&gt;
        &lt;/tr&gt;";
  </code></pre>
  
  <p>Can someone please correct the mistake I'm making in displaying array values in select control?</p>