title: Read Multiple Values from Array in Foreach Loop PHP
body: <p>I want to get array values one by one and add into foreach dynamically</p>
  
  <pre><code>$tracker = array('1','2','3')
  </code></pre>
  
  <p>I am able to do it manually by creating multiple foreach below</p>
  
  <pre><code>&lt;?php
  $tracker = array( '1' );
  $hashx = array( $hash );
  $info = $scraper-&gt;scrape( $hashx, $tracker );
  foreach ($info as $key =&gt; $value) {
      $openseed = $value['seeders'];
  }
  
  $tracker = array( '2' );
  $hashx = array( $hash );
  $info = $scraper-&gt;scrape( $hashx, $tracker );
  foreach ($info as $key =&gt; $value) {
      $pirateseed = $value['seeders'];
  }
  
  $tracker = array( '3' );
  $hashx = array( $hash );
  $info = $scraper-&gt;scrape( $hashx, $tracker );
  foreach ($info as $key =&gt; $value) {
      $rarbgseed = $value['seeders']; 
  }
  ?&gt;
  </code></pre>
  
  <p>But I want to add all array values to foreach dynamically at once instead of creating one by one manually</p>
  
  <pre><code>&lt;?php
  $tracker = array('1','2','3');
  
  $hashx = array( $hash );
  $info = $scraper-&gt;scrape( $hashx, $tracker );
  foreach ($info as $key =&gt; $value) {
      $openseed = $value['seeders'];
  }
  ?&gt;
  </code></pre>
  
  <p>The above code read only first array value and i want to read all array values and store the results separately and then calculate the total number of generated result by using <code>array_sum()</code> like this below</p>
  
  <pre><code>$totalseed = array($pirateseed,$openseed,$rarbgseed);
  echo 'Total &lt;font color="green"&gt;Seeders:&lt;/font&gt; '. array_sum($totalseed). '&lt;br /&gt;';
  </code></pre>
  
  <p>Any help will be appreciated thanks</p>