title: Remove duplicates from array and increment a value
body: <p>I'm trying to write a script that will make produce an easy overview over a list of orders.</p>
  
  <p>I have an array that looks like this:</p>
  
  <pre><code>Array(
  
      [0]=&gt;Array(
                [0] =&gt; name of product 1
                [1] =&gt; name of options for product
                [3] =&gt; quantity (an integer)
                )
      [1]=&gt;Array(
                [0] =&gt; name of product 2
                [1] =&gt; name of options for product
                [3] =&gt; quantity (an integer)
                )
      etc.
  )
  </code></pre>
  
  <p>What I want to do is to check where keys [0] and [1], i.e the same product with the same options, and remove duplicates. At the same time, I want the value [3] to be incremented with the number in the arrays that were removed. To simplify, I want to merge value [3] where product and options match. I've been thinking about this for a long time but can't figure out how to do it. Any suggestions?</p>