I have the following test on some data:
if(isset($option_type)
&& ($option_type == 3 || $option_type == 4
&& (isset($ext_data) && $ext_data != "")
)
){}
What it should do, is if $option type is NOT 3 or 4, the test should return true. If $option type is 3 or 4 AND $ext_data does not exist or equals "", then the test should return false.
However, no matter what $option_type is, it returns false.
How can I format this test so when the $option_type is 3 or 4 and $ext_data exists and is not "", the result is true?
lee
&&on your third line only applies if$option_type == 4. Due to lazy logic, if$option_type == 3the code won't even bother computing the third line.