title: How to increment by 1 and by 2 in PHP for loop
body: <p>I am trying to increment two separate numbers in the same for loop. For example I want the first number to be:</p>
  
  <pre><code>0,2,4,6,8,10 etc
  </code></pre>
  
  <p>I want the second number to be:</p>
  
  <pre><code>1,3,5,7,9 etc
  </code></pre>
  
  <p>I have tried what was suggested here but could get it to work:</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/19831399/how-to-increment-a-number-by-2-in-a-php-for-loop?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">How to increment a number by 2 in a PHP For Loop</a></p>
  </blockquote>
  
  <p>My code so far:</p>
  
  <pre><code>$count = count($toyList);
  echo $count;
  for($i=0; $i&lt;$count; $i++){
      $json = '{"toy": {"toyname":"' . $toyList[$i+2] . ',"status":"' . $toyList[$i+3] . '"}}';
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thanks.</p>