How can I sum all key values and then remove duplicate keys ?
My example array:
$eg=array("105"=>"3", "106"=>"1", "122"=>"7", "105"=>"1", "310"=>"3", "105"=>"5", "310"=>"2");
I want to output an array that will have sumed the values and removed duplicate keys:
[105]=9
[106]=1
[122]=7
[310]=5
("105"=>"9", "106"=>"1", "122"=>"7", "310"=>"5");
Thank you very much,
B.