I have $var1, $var2, $var3 and $type. I want to check if $var1 and $var2 are empty when $type=1 but when $type=2 I want to check if $var1, $var2 and $var3 are empty.
I’ve tried with
if(($type==1 AND empty($var) AND empty($var1)) OR ($type==2 AND empty($var1) AND empty($var2) AND empty($var3)))
{//...}
but it doesn’t work in the second case when $type=2;
So how to get this done with one if statement?
Don’t use “if”, but take advantage of dropping through the cases in a switch