title: fill dropdown from array
body: <p>I have the following codes...</p>
  
  <pre><code>$all  = $ent-&gt;getAll($fed_code);
  
   Array ( [NC] =&gt; Array (
      [101] =&gt; banana,
      [102] =&gt; orange,
      [103] =&gt; apple,
      )
      )
  
  
  $select  = $ent-&gt;getSelected($fed_code);
  
  Array
  (
  [101] =&gt; banana,
  )
  </code></pre>
  
  <p>what i want is if the $select value is found in $all array, Then fill the dropdown by the value selected.
  Here is the Code i have At the moment</p>
  
  <pre><code>&lt;?php
      foreach ($all as $orgKey =&gt; $list) { 
  ?&gt;
  &lt;tr&gt;&lt;td width="5%"&gt;
          &lt;h5&gt;Extra Fruits&lt;/h5&gt;
      &lt;/td&gt;
      &lt;td width="10%"&gt;
          &lt;label class="control-label"&gt;Fruits&lt;/label&gt;
          &lt;select class="input-xlarge" id="input" name="ent[]"&gt;   
              &lt;option value=""&gt;Select&lt;/option&gt;';
  
              &lt;?   foreach ($list as $key =&gt; $value) { 
                      $selected = in_array($select, $key)?'selected="selected"':'';
                      echo $selected;
                  ?&gt;
  
                  &lt;option &lt;?=$selected?&gt; value="&lt;?=$key?&gt;"&gt;&lt;?=$value?&gt;&lt;/option&gt;
                  &lt;? } ?&gt;
          &lt;/select&gt;
      &lt;/td&gt;
                          &lt;/tr&gt;
  </code></pre>
  
  <p>But, It seems there is something wrong, it doesn't select any thing.
  Some one has some idea please?</p>