Hi Everyone,
I have this array:
Code:
Array
(
[0] => Array
(
[productid] => 16141
[amount] => 1
)
[1] => Array
(
[productid] => 129
[amount] => 1
)
[2] => Array
(
[productid] => 16141
[amount] => 1
)
)
I was wondering if there was a function that would take the values of the array and add up the amounts or identical productids so that the result would look something like this:
Code:
Array
(
[0] => Array
(
[productid] => 16141
[amount] => 2
)
[1] => Array
(
[productid] => 129
[amount] => 1
)
)
I looked on php.net, but either I am missing it or it doesn't exist. Hopefully someone knows how to do this.
Thanks
