I have two arrays
$products_id={100, 101, 102, 101};
$quantity={10, 10, 10, 10}
for products_id 100, 101, 102, 101, I have 10 items each in the shopping cart.
How I walk though this array, and merge the emelments with the same products_id and add up the quantity. The new arrays I want are
$products_id={100, 101, 102};
$quantity={10, 20, 10};
Thanks!