Why is there == 0 near some modulo in PHP?

Mostly the way I have seen the code snippets provided is in a loop:

<?php

for($i=0; $i<10; $i++) 
{
   if( $i % 3 == 0 )
   {
       echo '<br>';
    }
    echo $i. ', ';
}//

Try running the script and notice when the modulus is equal to zero a line-feed is echoed.

1 Like