Im not a php expert at all, and I am looking for simple php loop that will add 1 to every third number
This should look like this
111 222 333 444 555 666 777
and it will repeat 20 times.
Thank you for your help in advance!
Im not a php expert at all, and I am looking for simple php loop that will add 1 to every third number
This should look like this
111 222 333 444 555 666 777
and it will repeat 20 times.
Thank you for your help in advance!
Try this one:
for($i=1; $i <= 20; $i++ )
{
echo $i.$i.$i."<br />";
}
$i.$i.$i.$i.$i.$i.$i.$i.$i.$i..??$i.$i.$i because of it's just three time. If he wanted 10 times, i would make with nested for or function or another thing. No need to force for 3 times ;)better approach to use str_repeat
click here to look at demo
for($i=1; $i <= 20; $i++ ){
echo str_repeat($i, 4), '<br />';
}