sum of duplicates in array where 2 row php : This is a section of my array:

    [1] => Array
    (
        [quantity] => 2
        [product_id] => 1
        [option_id] => 22
    )

    [2] => Array
    (
        [quantity] => 2
        [product_id] => 2
        [option_id] => 22
    )

    [3] => Array
    (
        [quantity] => 3
        [product_id] => 2
        [option_id] => 22
    )

    [4] => Array
    (
        [quantity] => 1
        [product_id] => 2
        [option_id] => 25
    )


All I wish to do is, say where the product_id key of the array is the same (e.g. here 2) and the option_id key of the array is the same (e.g. here 22) I want to show this product_id and option_id once, but with combined values of the duplicate item....?

e.g

    [1] => Array
    (
        [quantity] => 2
        [product_id] => 1
        [option_id] => 22
    )

    [2] => Array
    (
        [quantity] => 5
        [product_id] => 2
        [option_id] => 22
    )

    [3] => Array
    (
        [quantity] => 1
        [product_id] => 2
        [option_id] => 25
    )