Can’t seem to find anything on this, though I might just not know what i’m looking for.
I want to check if out of 6 variables, how many of them are yes. So if four return “no” values, then two are yes.
I was thinking to set up an if chain where
$var_array = 0;
if ($var1 == "yes"){
$var_array++;
}
if ($var2 == "yes"){
$var_array++;
}
Then use the array to tell me how many yes values were returned.
Which naturally would work, but would be a long process. Is there an easier way [or more eloquent] to do this?
1 Answer