Modulo Operator in PHP
In computing, the modulo operation finds the remainder of mathematical division of one number by another. Given 2 numbers, a (dividend) and n (divisor), a modulo n is the remainder, on division of a by n.
In php languages, the modulo operator is the percent sign: %.
PHP modulo operator – code example:
for($i=0; $i<10; $i++)
{
if ($i % 2)
{
# the even number (0,2,4,6,8,10)
} else {
# the odd number (1,3,5,7,9)
}
}








