$arr2 = [];
foreach($arr as $item) {
if(!empty($arr2[$item['times']])) {
$arr2[$item['times']] = $arr2[$item['times']] + (int) $item['quantity'];
} else {
$arr2[$item['times']] = (int) $item['quantity'];
}
}