I have two indexed arrays $measurements[] and $diffs[] ,
$measurements[] is filled with values from a database and the $diffs[] gets values from a function which calculates the difference from two measurements.
When I have a collection of different measurements in $measurements[] I want to add a value to just one array element in the $diffs[] array and then loop through it, then where the array element got updated check for corresponding index array element in the $measurements[] array en deduct it from there.
What I'm trying to accomplish is to have a specific difference deducted from a corresponding measurement when I have a collection of measurments.
Is this possible in php and how would I go about doing this.
Edit: to make it more descriptive (english is not my first language nor is php)
$measurements Array ( [0] => 1469 [1] => 1465 [2] => 739 [3] => 849 )
$diffs Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 )
I would like to update $diffs array index [2] => 200 so it becomes
Array ( [0] => 0 [1] => 0 [2] => 200 [3] => 0 )
and then subtract $diffs array index [2] from $measurements array index [2] in this case 739 - 200
I sincerely hope this makes it more clear.