how to use a for loop to write a line several times php code example
Example 1: php loop x times
for ($i = 1; $i <= 10; $i++) {
echo $i;
}
Example 2: php for next loop step
for ($i = 0; $i < 10; ++$i)
{
echo "I will loop 10 times";
}
for ($i = 1; $i <= 10; $i++) {
echo $i;
}
for ($i = 0; $i < 10; ++$i)
{
echo "I will loop 10 times";
}