I am running a very simple if statement which works perfect until I add the two additional || (or) operators.
Here is my code:
if ($planDetails['Company']['name'] != 'company1'
|| $planDetails['PlanDetail']['name'] != 'pd-name1'
|| $planDetails['PlanDetail']['name'] != 'pd-name2') { echo "TEST"; }
I've checked my array data and table values to ensure they are precise in the names etc.. And this is not kicking. What am I doing wrong? When I remove the additional 2 || options, the first argument works fine, so I know my logic is correct.
What in the name am I doing wrong here. Someone please set me straight!
Well, what I read here is:
If $variable is not equal to A Or $variable is not equal to B
Then echo "TEST"
Since $variable cannot be equal to both A and B at the same time, it will always print "TEST".
Of course, the above refers to the last two conditions in your if.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With