I have arrays where keys is math operations to it's values.
$a = array('1'=>'100','4'=>'25','3'=>'10');
$b = array('1'=>'120','5'=>'40','3'=>'5');
$c = array('1'=>'300','3'=>'15','2'=>'75');
$d = array('1'=>'75','5'=>'15');
The list of operations:
$list = array(
'1' => 'Set the price',
'2' => 'Raise by the number',
'3' => 'Decrease by the number',
'4' => 'Increase by %',
'5' => 'Decrease by %',
);
So i need to get the single value from each array and this value will be the result of math operations e.g:
1) $summ_a = 100 + 100*0,25 -10;
2) $summ_b = 120 - 120*0,4 -5;
3) $summ_c = 300 - 15 +75;
I tried ineffectively built-in php functions like array_walk, array_reduce, etc and have no idea how to achieve this.
How to achieve this? Any help would by greatly appreciate.