title: how to use round robin method in array in php?
body: <p>Hi i am trying to create a sub array from an array.i.e; think I have an array such as given below</p>
  
  <pre><code> $array = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}
  </code></pre>
  
  <p>which I <strong>explode</strong> and assign it to a variable $i..
  and run the for loop as shown below..</p>
  
  <pre><code>for ( $i=0;$i&lt;count($array);$i++) {
      $a = array();
      $b = $array[$i];
      for($j=0;$j&lt;count($array);$j++){
          if($b != $array[$j]){
  
              $a[] = $array[$j];
          }
      }
  </code></pre>
  
  <p>the output I want is when </p>
  
  <pre><code>$i = 1 
  </code></pre>
  
  <p>the array should be </p>
  
  <pre><code>{2,3,4,5,6,7,8,9,10,11} 
  </code></pre>
  
  <p>and when </p>
  
  <pre><code>$i = 2 
  </code></pre>
  
  <p>the array should be </p>
  
  <pre><code>{3,4,5,6,7,8,9,10,11,12}
  </code></pre>
  
  <p>similarly when </p>
  
  <pre><code>$i=19
  </code></pre>
  
  <p>the array should be</p>
  
  <pre><code>{1,2,3,4,5,6,7,8,9,10}
  </code></pre>
  
  <p>so how can I do it.</p>