How can the Modulo function be used to insert a line break after every 10th checkbox in a PHP form?

To insert a line break after every 10th checkbox in a PHP form, we can use the Modulo (%) operator to check if the current checkbox index is divisible by 10. If it is, we can add a line break to the form output. This will ensure that after every 10 checkboxes, a new line is inserted for better readability.

<form>
<?php
for ($i = 1; $i <= 100; $i++) {
    echo '<input type="checkbox" name="checkbox'.$i.'"> Checkbox '.$i;
    
    if ($i % 10 == 0) {
        echo '<br>'; // Insert line break after every 10 checkboxes
    }
}
?>
</form>