I have two arrays. They are always the same length. If the first array element value is the same then sum of the second array element value.
Example
$array1 = array(1,2,2,3);
$array2 = array(10,20,30,50);
// I can get the sum of array1 and array2 output.
$array_sum1 = array(10,50,50);
$array3 = array(4,4,4,6);
$array4 = array(10,20,30,50);
// I can get the sum of array3 and array4 output.
$array_sum2 = array(60,50);
How do I go about achieving this?