title: How can I loop over an array as many times as I want to?
body: <p>I want to iterate over my array as many times as I want, so I get an output like this:</p>
  
  <pre><code>1 -&gt; R
  2 -&gt; G
  3 -&gt; B
  4 -&gt; B
  5 -&gt; G
  6 -&gt; R
  7 -&gt; R
  8 -&gt; G
  9 -&gt; B
  10 -&gt; B
  ...
  
  Till 100
  </code></pre>
  
  <p>So far I started with this code:</p>
  
  <pre><code>$range = range(1,100);
  $color = array("Red", "Green", "Blue");
  $clr = 0;
  for($i=0; $i&lt;count($range); $i++){
  
      echo "&lt;div style='color :".$color[$clr]."'&gt;".$range[$i]. " " .$color[$clr]. "&lt;br&gt;"; 
      $clr++;
  
      if($clr == 3){  
          $clr = 0;   
      }   
  }
  </code></pre>