I have an array which will have an SKU number, it can be repeated so want to sum of that SKU qty at once and insert in DB table.
`$data = array(
0 => array(
'0' => 'SKU',
'1' => 'header1',
'2' => 'header2',
'3' => 'qty'
),
1 => array(
'0' => 'SKU-abc',
'1' => 50,
'2' => 0,
'3' => 50
),
2 => array(
'0' => 'SKU-pqr',
'1' => 50,
'2' => 0,
'3' => 50
),
3 => array(
'0' => 'SKU-abc',
'1' => 0,
'2' => 25,
'3' => 25
)`
How can i sum the same sku as index 1 and 3 have and remove the 1st index?