title: Multiply value of 2 indexes in foreach loop
body: <p>I want to multiply the values of 2 indexes in my foreach loop. </p>
  
  <p>E.G.</p>
  
  <pre><code>foreach($items as $item)
  {
      $result=$item['foo']*$item['bar'];
  }
  </code></pre>
  
  <p>Then I want to return the result of the sum of all the $result within the function. For example,there are 2 rows of results in the foreach loop, I want to sum them up and return $sum. Anybody knows how to do that?</p>