I am fairly new to PHP and I am trying to solve this problem where I need to make a for loop to generate 10 random numbers from the range (1,20) and then output whether they are odd or even.
I am so stuck on this though. So far I have this below, but I know its wrong somewhere. Any help or guidance would be much appreciated.
$rand120 = rand(1, 20);
for($rand120 = 10; $rand120 <= 20; $rand120++);
{
echo "$rand120"."<br/>";
}
if ($rand120 % 2 === 0) {
echo "$rand120 is even </br>";
} else {
echo "$rand120 is odd </br>";
}