title: Can I put associative arrays in form inputs to be processed in PHP?
body: <p>I know I can do things like <code>&lt;input name="foo[]"&gt;</code>, but is it possible to do things like <code>&lt;input name="foo[bar]"&gt;</code> and have it show up in PHP as <code>$_POST['foo']['bar']</code>?</p>
  
  <p><em>The reason I ask is because I'm making a huge table of form elements (including <code>&lt;select&gt;</code> with multiple selections), and I want to have my data organized cleanly for the script that I'm POSTing to. I want the input elements in each column to have the same base name, but a different row identifier as an array key. Does that make sense?</em></p>
  
  <p><strong>EDIT:</strong> I tried exactly this already, but apparently Drupal is interfering with what I'm trying to do. I thought I was just getting my syntax wrong. Firebug tells me that my input names are constructed exactly like this, but my data comes back as <code>[foo[bar]] =&gt; data</code> rather than <code>[foo] =&gt; array([bar] =&gt; data)</code>.</p>
  
  <p><strong>EDIT 2:</strong> It seems my real problem was my assumption that <code>$form_state['values']</code> in Drupal would have the same array hierarchy as <code>$_POST</code>. I should never have assumed that Drupal would be that reasonable and intuitive. I apologize for wasting your time. You may go about your business.</p>