title: codeigniter don't get the right value using for loop
body: <p>i'm struggling getting the right values in of a for loop.</p>
  
  <p>here is the data that i pass from the controller to the view</p>
  
  <pre><code> $data['moisString'] = $moisString;
   //result of var_dump
   var_dump($data['moisString'] );
          array (size=3)
             0 =&gt; string 'Janvier' (length=7)
             1 =&gt; string 'Février' (length=8)
             2 =&gt; string 'Mars' (length=4)
  
   $data['year'] = $year;
   //result of var_dump
   var_dump($data['year'] );
          array (size=3)
             0 =&gt; int 2014
             1 =&gt; int 2014
             2 =&gt; int 2014
  </code></pre>
  
  <p>in my view i have a form_dropdown and i want to obtain something like:</p>
  
  <pre><code>****************
  * Janvier 2014 *
  * Février 2014 *
  * Mars 2014    *
  **************** 
  </code></pre>
  
  <p>here is the view:</p>
  
  <pre><code>echo form_open('suivrePaiement/view', 'method="get"');
  
  $month = array();
  $annee = array();
  
  for ($i = 0; $i &lt; count($moisString); $i++) {
       $month[] = $moisString[$i];
       $annee[]= $year[$i];
             foreach ($ficheFrais as $mois) {
             $options[$mois-&gt;mois] = $month[$i]." ".$annee[$i];
             }
      }   
  
  echo form_dropdown('mois', $options, $this-&gt;input-&gt;get('mois'), 'class="btn btn-default  
  
  dropdown-toggle"');
  
  echo form_hidden('visiteur', set_value('visiteur', $this-&gt;input-&gt;get('visiteur')));
  echo form_submit('', 'Envoyer', 'class="btn btn-info"');
  
  echo form_close();
  </code></pre>
  
  <p>but this is what i get:</p>
  
  <pre><code>*************
  * Mars 2014 *
  * Mars 2014 *
  * Mars 2014 *
  *************
  </code></pre>
  
  <p>does anyone has a solution to this? thanks for your time!</p>