I’m new to this, and I think there some issue with my if-else structure, but I cant understand what the problem actually is.
I’m trying to do the following:
<?php
$num = 1;
while($num <=10)
{
if ($num < 4)
{
print $num . " is less than 4 /";
}
elseif ($num = 4)
{
print $num . " is just 4 /";
}
elseif (($num > 4) && ($num < 10))
{
print $num . " is more than 4 and less than 10 /";
}
elseif ($num = 10)
{
print $num . " is just 10 /";
}
$num++;
}
?>
I have a couple hours around this so I finally decided to ask.
Any help will be appreciated! Ty in advance for reading.
You are using assignment operator ‘=’, use conditional operator