I am trying to use a modulus in my if statement, however I cannot get it working or find an example of this anywhere and it is not the same as in other languages I have done. So far ive tried
if ($counter % "10" = 2)
{
echo ($counter);
echo "Have a good morning!";
}
and
if ($counter % 10 = 2)
{
echo ($counter);
echo "Have a good morning!";
}
and
if (($counter % "10") = 2)
{
echo ($counter);
echo "Have a good morning!";
}
Yet still nothing is working, I am getting the error
Parse error: syntax error, unexpected '=' in H:\STUDENT\S0190204\GGJ\index.php on line 50
Although that is probably because the syntax is incorrect, if anyone could shed some light on this or point me in the direction of a site that shows a modulus used in an if statement in php Id appreciate it. Thank you
=assignment;==comparison