I am trying to create a loop that displays 100 numbers grouped by 5 with a tab between them like this:
I have done this code but I can't get it to work:
<?php
$max_num = 101;
$contador =0;
for ($x=1;$x<$max_num;$x++)
{
$contador++;
if (fmod($contador, 5) == 1)
{
echo "<br>";
}
echo $x. " ";
}
?>
Thanks.
Edit. With this in the if the numbers work for me: (fmod($counter, 5) == 1). Updated, I'm missing tab detection, \t doesn't detect it.
I have managed to do it but I don't know if it is the most recommended option:
echo $x." "." "." "." "." ";
I would leave it like this