there are 10 variables. say $var1, $var2, $var3, $var4,....$var10
and a $count
variable. what I am looking for is if all variables are set then $count = 10+1
or if 9 variables only set then $count=9+1
or if 8 variables only set then $count=8+1
and so on last up to 1 variable(for one variable is set then $count = 1+1
).
I know do this with If
, Else if
and else
but I need to write too much line of code.
Does any one know how to do this in brief code??