title: PHP foreach iterate twice instead of once
body: <p>I have a question regarding the foreach function in php:</p>
  
  <p>At the moment I have:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;?php
  
  $x=array("one","two","three", "four", "five", "six", "seven", "eight"); 
  
  foreach ($x as $value)
    {
      echo $value . "&lt;br /&gt;";
    }
  ?&gt;
  </code></pre>
  
  <p>
      </p>
  
  <p>Which outputs:</p>
  
  <pre><code>one
  two
  three 
  four
  five
  six
  seven
  eight
  </code></pre>
  
  <p>But how do I make a foreach loop iterate twice instead of once so that I get:</p>
  
  <pre><code>two
  four 
  six 
  eight
  </code></pre>
  
  <p>Is this even possible? Or is it better to just use a for loop instead?</p>
  
  <p>Any help will be appreciated, thank you.</p>