如何循环并打印每个值? [关闭]

How can I loop from 0 to 100 and for each value print an output in the following pattern :

1, 4, 7, 10,.. will print animationOne
2, 5, 8, 11,.. will print animationTwo
3, 6, 9, 12,.. will print animationThree

Here's what I've tried:

for ($i=1; $i<=100; $i++) {
   if($i==(1+($i-1)*3)) { 
      echo "animationOne".$i;
   } elseif($i==(2+($i-1)*3)) {
      echo "animationTwo".$i;
   } elseif($i==(3+($i-1)*3)) {
      echo "animationThree".$i;
   }
}

Thanks

Use this loop :

for ($i=1; $i<=100; $i++)
{
  if($i%3==1){ 
    echo "animationOne".$i;
  }elseif($i%3==2){
    echo "animationTwo".$i;
  }elseif($i%3==0){
    echo "animationThree".$i;
  }
}