title: Uninitialized string offset with Codeigniter
body: <p>I'm trying to run a dabatase query on an array of fields from a single form but I keep getting the following error:</p>
  
  <blockquote>
    <p>A PHP Error was encountered</p>
  
  <pre><code>Severity: Notice
  
  Message: Uninitialized string offset: 1
  
  Filename: controllers/admin.php
  
  Line Number: 259
  </code></pre>
  </blockquote>
  
  <p>I can't figure out what's causing it, code below:</p>
  
  <p>View:</p>
  
  <pre><code>&lt;input class="Form_Input" name="stock_level[]" id="stock_level[]"  value="&lt;? echo $product['current_stock']; ?&gt;" style="width: 30px;" /&gt;
  &lt;input class="Form_Input" name="product_id[]" id="product_id[]"  value="&lt;? echo $product['id']; ?&gt;"  /&gt;
  &lt;input class="Form_Input" name="batch_id[]" id="batch_id[]" type="hidden" /&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>$keys = $this-&gt;input-&gt;post('stock_level', TRUE);
  $product_id = $this-&gt;input-&gt;post('product_id', TRUE);
  $batch_id = $this-&gt;input-&gt;post('batch_id', TRUE);
  $result = array();
  
  foreach ($keys as $id =&gt; $key)
  {
   $result[$key] = array(  
  'stock_level' =&gt; $keys[$id],
  'product_id' =&gt; $product_id[$id]
  );
  
  $stock_level = $result[$key]['stock_level'];
  $product_id = $result[$key]['product_id'];
  
  $this-&gt;admin_model-&gt;update_stock_level($product_id, $stock_level);
  </code></pre>