title: Set multiple values as selected in form_multiselect() in codeigniter
body: <p>I wonder if there's a way of setting multiple (say 3) values 'selected' in form_multiselect().
  I got it working with only 1 value using key($selectie) where <code>$selectie</code> is my query to get the values form the database for a specific company id.</p>
  
  <p>My model query looks like this:</p>
  
  <pre><code>function getselection($id2)
  {
      $this-&gt;db-&gt;from('bedrijfcategorieen');
      $this-&gt;db-&gt;join('categorieen', 'bedrijfcategorieen.idcategorieen = categorieen.idcategorieen');
      $this-&gt;db-&gt;where('bedrijfcategorieen.idbedrijven', $id2);
      $query = $this-&gt;db-&gt;get();
  
      return $query-&gt;result_array();
  }
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>    $data['selected'] = $this-&gt;members_model-&gt;getselection($id2);
  </code></pre>
  
  <p>My views:</p>
  
  <pre><code>&lt;?php
      foreach($selected as $row){
          $selectie[$row['idcategorieen']] = $row['Categorie'];
      }
      echo '&lt;pre&gt;';
      print_r($selectie);
      echo '&lt;/pre&gt;';
  ?&gt;
  
  &lt;tr&gt;
  &lt;td&gt;&lt;?= form_label('Categorieen'); ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?= form_multiselect('categorieen[]', $opties, key($selectie)); ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>print_r($selectie); produces:</p>
  
  <pre><code>Array
  (
      [11] =&gt; Webdesign
      [12] =&gt; Vlaggen
      [13] =&gt; Auto-s
  )
  </code></pre>