print selected value in dropdown in Codeigniter
<p>Okay so I recently Swtiched from PHP to Codeigniter. I am newbie to CI framework.This is my PHP Code:</p>

<pre><code>&lt;td&gt;
                  &lt;?php 
                  include 'template_category.php';
                   $categoryList = fetchCategoryTree();
                    ?&gt;
                   &lt;select name="make"&gt;
                    &lt;?php foreach($categoryList as $cl) 
                    { 
                      if($cl["id"]!==$PRODUCTCATEGORY)
                        {
                          echo "Hey Matched!";
                        }
                        else
                        {?&gt;
                          &lt;option selected value="&lt;?php echo $cl["id"] ?&gt;"&gt;&lt;?php echo $cl["name"]; ?&gt;&lt;/option&gt;  
                        &lt;?php }

                      ?&gt;
                      &lt;option value="&lt;?php echo $cl["id"] ?&gt;"&gt;&lt;?php echo $cl["name"]; ?&gt;&lt;/option&gt;
                    &lt;?php } ?&gt;
                    &lt;/select&gt;
              &lt;/td&gt;
</code></pre>

<p>Now how can I Convert into CI's syntax. I mean I don't know how to give conditions inside Dropdown.</p>

<pre><code>&lt;tr&gt;
    &lt;td align="right"&gt;&lt;? echo form_label('Category');?&gt;&lt;/td&gt;
    &lt;?php $this-&gt;load-&gt;view('template_category'); $options= array(''=&gt;'',''=&gt;'');$categoryList = fetchCategoryTree(); ?&gt;
    &lt;td&gt;&lt;? echo form_dropdown(array('id' =&gt;'address','name' =&gt;'address' )); ?&gt;&lt;br/&gt;&lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>How can I make my CI code works like ditto As Above mentioned PHP.
Deeply: I don't know how to give conditions inside dropdown in CI.</p>