title: CodeIgniter: Getting data from form array into post array
body: <p>I'm racking my brain. I'm using CodeIgniter, trying to get a value from a form checkbox into a data array to send off to the database. Here are the snippets:</p>
  
  <p>Form (view):</p>
  
  <pre><code>&lt;label&gt;Rental Car?&lt;/label&gt;&lt;input type="checkbox" name="options[is_rental]" value="1" &lt;?php echo set_checkbox('options[is_rental]', '1', FALSE); ?&gt; /&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>$data['is_rental'] = $this-&gt;input-&gt;post('options[is_rental]');
  </code></pre>
  
  <p>Now, <strong>during this process I'm also validating and re-populating the form with data using options[is_rental] and that works just fine.</strong> Using var_dump I get:</p>
  
  <p>Dumps (with the checkbox checked) from the controller:</p>
  
  <pre><code>var_dump($this-&gt;input-&gt;post('options[is_rental]'))
  </code></pre>
  
  <p>Returns</p>
  
  <pre><code>bool(false)
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>var_dump($this-&gt;input-&gt;post('options'))
  </code></pre>
  
  <p>Returns</p>
  
  <pre><code>array(3) { ["engine"]=&gt; string(4) "4cyl" ["transmission"]=&gt; string(9) "automatic" ["is_rental"]=&gt; string(1) "1" }
  </code></pre>
  
  <p>For what it's worth, I can't get to those other values in the array either.</p>