title: How to indent text in a select drop down option menu using PHP & CSS? [REDUX]
body: <p>I asked a similar question earlier but I'll ask it again in a different way because I re-worked the code a little. </p>
  
  <p>I was wondering how can I indent categories and endless sub categories that I have in a select drop down menu using PHP &amp; CSS?</p>
  
  <p>Here is my PHP code to display the select drop down.</p>
  
  <pre><code>echo '&lt;select name="parent_id"&gt;
        &lt;option value="0"&gt;None&lt;/option&gt;';
  
  function make_list ($parent) {
  
      global $option;
  
      foreach ($parent as $id =&gt; $cat) {
  
          echo '&lt;option value="' . $cat['id'] . '"&gt;' . $cat['category'] . '&lt;/option&gt;';
  
          if (isset($option[$id])) { 
  
              make_list($option[$id]);
  
          }                       
      }       
  }
  
  $mysqli = mysqli_connect("localhost", "root", "", "sitename");
  $dbc = mysqli_query($mysqli,"SELECT * FROM categories ORDER BY parent_id, category ASC");
  
  if (!$dbc) {
      print mysqli_error();
  } 
  
  $option = array();
  
  while (list($id, $parent_id, $category) = mysqli_fetch_array($dbc, MYSQLI_NUM)) {
  
      $option[$parent_id][$id] =  array('category' =&gt; $category, 'id' =&gt; $id, 'parent_id' =&gt; $parent_id);
  
  }
  
  make_list($option[0]);
  
  echo '&lt;/select&gt;';
  </code></pre>
  
  <p>Here is the output.</p>
  
  <pre><code>   1. Apple
     2. Arts &amp; Entertainment
           1. Amusement
           2. Art
           3. Artists
                 1. A
                       1. a1
                       2. a2
                 2. B
                 3. C
                 4. D
     3. Automotive
     4. Network
     5. Server
     6. Web Design
           1. CSS
           2. HTML
  </code></pre>
  
  <p>The numbers are just there to see the categories and sub categories easier.</p>