fork download
  1. <?php
  2.  
  3. for ($i = 0; $i < 10; ++$i) {
  4. $targetDivNumber = ($i % 3) + 1;
  5. echo "Item #".($i + 1)." goes into div$targetDivNumber\n";
  6. }
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
Item #1 goes into div1
Item #2 goes into div2
Item #3 goes into div3
Item #4 goes into div1
Item #5 goes into div2
Item #6 goes into div3
Item #7 goes into div1
Item #8 goes into div2
Item #9 goes into div3
Item #10 goes into div1