PHP / WordPress logic help (&&, ||, etc)
-
I’m working on a plugin for WP but I am running into a PHP logic problem. Given $Var_check equals “1” and my_function does exist , what is wrong with my logical PHP statement below. It always echo’s ‘Always get this…’ when it should actually return ‘I should get this but…’
// Check to see if options are logical
if ( ($Var_check == “1”) || ($Var_check == “6”) && (function_exists(‘my_function’))) {
echo “I should get this, but…”;
} else {
echo ‘Always get this…’}Is it my syntax? Any help would be very much appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘PHP / WordPress logic help (&&, ||, etc)’ is closed to new replies.