title: CodeIgniter] Empty Optgroup using form_dropdown
body: <pre><code>    foreach($product_categories as $product_category)
      {
          $options = array();
          foreach($series_categories as $series_category)
          {
              if($product_category['prod_cate_idx'] == $series_category['prod_cate_idx'])
              {
                  $options[$series_category['series_cate_idx']] = $series_category['series_cate_name'];
              }
          }
          if(count($options) &gt; 0)
          {
              $series_category_dropdown[$product_category['prod_cate_name']] = $options;
          }
          else
          {
              //problem here. how to make a empty optgroup?
              $series_category_dropdown[$product_category['prod_cate_name']] = array('', NULL);
          }
          empty($options);
      }
  </code></pre>
  
  <p>Okay, i have two categories here - one is product categories and the other is series categories that goes under one of product categories. A product category may or may not have series categories.</p>
  
  <p>I need to make a dropdown menu like this:</p>
  
  <ul>
  <li>A
  <ul>
  <li>a</li>
  <li>a</li>
  <li>a</li>
  <li>a</li>
  </ul></li>
  <li>B
  <ul>
  <li>b</li>
  <li>b</li>
  <li>b</li>
  </ul></li>
  <li>C</li>
  <li>D</li>
  <li>E
  <ul>
  <li>e</li>
  <li>e</li>
  <li>e</li>
  </ul></li>
  </ul>
  
  <p>The code given is perfectly working except that I don't know how to deal with the empty optgroups :S</p>
  
  <p>I googled tons to figure out how to generate empty optgroups like C &amp; D but haven't found  solutions or anyone has tried it yet :(   Does anyone have a clue how I should generate a multi-dimensional array to make it happen?  Thank you.</p>