Is this possible with php
<p>I have two indexed arrays $measurements[] and $diffs[] ,</p>

<p>$measurements[] is filled with values from a database and the $diffs[] gets values from a function which calculates the difference from two measurements.</p>

<p>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.</p>

<p>What I'm trying to accomplish is to have a specific difference deducted from a corresponding measurement when I have a collection of measurments.</p>

<p>Is this possible in php and how would I go about doing this. </p>

<p>Edit: to make it more descriptive (english is not my first language nor is php)</p>

<pre><code>$measurements Array ( [0] =&gt; 1469 [1] =&gt; 1465 [2] =&gt; 739 [3] =&gt; 849 ) 

$diffs Array ( [0] =&gt; 0 [1] =&gt; 0 [2] =&gt; 0 [3] =&gt; 0 )
</code></pre>

<p>I would like to update $diffs array index [2] => 200 so it becomes</p>

<pre><code>Array ( [0] =&gt; 0 [1] =&gt; 0 [2] =&gt; 200 [3] =&gt; 0 )
</code></pre>

<p>and then subtract $diffs array index [2] from $measurements array index [2] in this case 739 - 200</p>

<p>I sincerely hope this makes it more clear.</p>
