I have the array
$vetor[0]['codigo'] = '1';
$vetor[0]['valor'] = '4';
$vetor[1]['codigo'] = '1';
$vetor[1]['valor'] = '2';
$vetor[2]['codigo'] = '2';
$vetor[2]['valor'] = '2';
I need to merge all values with equal codes. Doing the above example looks like this:
Code 1 has a value of 6
And code 2 gets value 2
Does anyone have any idea how to do this?