0
I have a simple FOR that I need that every 6 increments it sends an echo with a message, follows code:
$carros = array("Volvo", "BMW", "Toyota", "Alfa Romeu", "WV", "Teste", "test2", "Teste4", "Teste3", "Teste5", "Volkswagem", "Ferrari");
for ($i=0; $i < count($carros); $i++) {
echo "Carro ".$carros[$i];
//quando chegar a 6, 12, 18, 24, 30... ele manda esse echo
echo "Página: ".$i;
}
send code examples...
– Alan PS
I edited the answer, using your own FOR logic and adding the if with the check. Making a 'MOD' of the counter value with 6, if the result is 0, means that the number is multiple of 6, and so will print the sequence you want. @Alanps
– lucaaslb