I need to do multiple checks for a variable. I’ve seen an “Equals” example, here: w3schools.
But they are two different variables. Right now I have:
if ($color == 'blue')
{
//do something
}
But I need to to multiple checks for $color. Eg if it equals red or green too. How is this written?
As simple as:
There are several other options. Using
switchoperator:Or more complex using
in_arrayfunction: