If you want to remove duplicates then sum of them from array then this code will help you. this is code which remove duplicate and sum of them.

$result = array();
foreach ($data as $val) {
    if (!isset($result[$val->reservations_detail_article]))
        $result[$val->reservations_detail_article] = $val;
    else
        $result[$val->reservations_detail_article]['reservations_detail_qte'] += $val['reservations_detail_qte'];
}

$result = array_values($result); 
print_r($result);

If you face any problem then inform me, i will try to help you.

Comment