title: Multiply two arrays
body: <p>I have two arrays which I want to multiply and get the final sum. First one is fixed but the second one could have missing elements. For example:</p>
  
  <pre><code>$array1 = array(1, 2, 3, 4, 5);
  $array2 = array(1, 3, 5);
  </code></pre>
  
  <p>Lets say I've got missing elements <code>$array2[1]</code> and <code>$array2[3]</code>. I want to be able to multiply and sum up the rest as:</p>
  
  <pre><code>$sum = array_sum($array1[0] * $array2[0] + $array1[1] * $array2[1] + $array1[2] * $array2[2] + $array1[3] * $array2[3] + $array1[4] + $array2[5]);
  </code></pre>
  
  <p>Length of arrays may also vary so can't do it the way I've written it above. Any suggestions?</p>