title: How to select all inputs having same name and index them by their name
body: <p>I have to handle a form generated by a third part. This form provides some checkbox "multi-select" attributes. But input name's are identical, and PHP $_POST can't handle identical keys (only the last data is handled).</p>
  
  <p>Here is an example of the form :</p>
  
  <pre><code>&lt;form&gt;
      &lt;input type="checkbox" name="attr1" value="1" /&gt;
      &lt;input type="checkbox" name="attr1" value="2" /&gt;
      &lt;input type="checkbox" name="attr1" value="3" /&gt;
      &lt;input type="checkbox" name="attr1" value="4" /&gt;
      &lt;input type="checkbox" name="attr2" value="xx" /&gt;
      &lt;input type="checkbox" name="attr3" value="a" /&gt;
      &lt;input type="checkbox" name="attr3" value="b" /&gt;
      &lt;input type="checkbox" name="attr3" value="c" /&gt;
      &lt;input type="checkbox" name="attr3" value="d" /&gt;
      &lt;input type="text" name="attr4" value="" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I'd like to parse all checkbox inputs, get only group of same name inputs, and append "[]" to their name...</p>
  
  <p>What I want to get after jQuery processing :</p>
  
  <pre><code>&lt;form&gt;
      &lt;input type="checkbox" name="attr1[]" value="1" /&gt;
      &lt;input type="checkbox" name="attr1[]" value="2" /&gt;
      &lt;input type="checkbox" name="attr1[]" value="3" /&gt;
      &lt;input type="checkbox" name="attr1[]" value="4" /&gt;
      &lt;input type="checkbox" name="attr2" value="xx" /&gt;
      &lt;input type="checkbox" name="attr3[]" value="a" /&gt;
      &lt;input type="checkbox" name="attr3[]" value="b" /&gt;
      &lt;input type="checkbox" name="attr3[]" value="c" /&gt;
      &lt;input type="checkbox" name="attr3[]" value="d" /&gt;
      &lt;input type="text" name="attr4" value="" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Is there a way to identify group of inputs with same name ?</p>