How can the PHP code snippet be optimized to include line breaks not only at 20 but also at multiples of 20 within the loop?

To include line breaks not only at 20 but also at multiples of 20 within the loop, we can use the modulus operator (%) to check if the current iteration index is a multiple of 20. If it is, we can insert a line break. This way, line breaks will be added at every 20th iteration and at multiples of 20 within the loop.

for ($i = 1; $i <= 100; $i++) {
    echo $i;
    if ($i % 20 == 0) {
        echo "<br>";
    }
}