I'm trying to write a script that will make produce an easy overview over a list of orders.
I have an array that looks like this:
Array(
[0]=>Array(
[0] => name of product 1
[1] => name of options for product
[3] => quantity (an integer)
)
[1]=>Array(
[0] => name of product 2
[1] => name of options for product
[3] => quantity (an integer)
)
etc.
)
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?