title: How to process groups of duplicate fields and organize by common field key - PHP / Array
body: <p>Looking to mimic what's going on on this website where you can add multiple field groups:   When you click "add another card", it duplicates the field -- I've got this covered with jquery and <code>clone()</code>.  However, if you input two gift cards with the same amount, on the next step they've combined the quantities for those gift cards into one group.  So here's a scenario that I'm facing and the output that I would like to see:</p>
  
  <p>User Input:</p>
  
  <pre><code>Field Group 1 -- Amount: $100 Quantity: 1
  Field Group 2 -- Amount: $75 Quantity: 2
  Field Group 3 -- Amount: $100 Quantity: 1
  </code></pre>
  
  <p>Desired Output on Next Page:</p>
  
  <pre><code>$100 Gift Card Group: 2
  $75 Gift Card Group: 2
  </code></pre>
  
  <p>I've been searching for different ways to do this and can't find anything, please help!!</p>