title: Sum column values from multiple arrays
body: <p>I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique</p>
  <pre><code>$loopThrice = 3;
  $getSum = 0;
  $total = array();
  
  $array0 = array(5, 10, 15, 20, 25, 30);
  $array1 = array(1, 2, 3, 4, 5, 6);
  $array2 = array(2, 6, 8, 10, 12, 14);
  
  for($a=0; $a &lt; $loopThrice; $a++){ // loop 3x to get unique array name
      foreach (${'array'.$a} as $key =&gt; $value) { // $array0, $array1, $array2,  
          //Right here is my problem, I'm not sure if this the correct way to get the sum of $array0,1,2
          
          //get the sum of array0,1,2 -- newarray(8, 18, 26, 34, 42, 50)
          $getSum += 
              //store newarray
              array_push($total, $getSum);     
      }
  }
  </code></pre>
  <p>I need to get an output like this:</p>
  <pre><code>Array ( 
      [0] =&gt; 8
      [1] =&gt; 18 
      [2] =&gt; 26 
      [3] =&gt; 34 
      [4] =&gt; 43 
      [5] =&gt; 50 
  )
  </code></pre>