In PHP, how can I not execute coming up code (not displayed in a div for example), if three conditions are true, and on the other hand, do execute it, if and only if any of these 3 conditions is false?
For example, the opposite of what I want to do is, in order to do execute code if the three conditions are indeed true, I do something like this:
<?php
$var1 = 'true';
$var2 = 'true';
$var3 = 'false';
?>
<?php if ( $var1 == 'true' and $var2 == 'true' and $var3 == 'true' ) : ?>
<?php echo 'All 3 are true, will execute code.'; ?>
<?php else : ?>
<?php echo 'Not all 3 are true, will not execute code.'; ?>
<?php endif; ?>
Result: Not all three are true, thereby the code will not get executed.
Hope I was understood, Thanks in advance.
'true'
) rather than booleans (true
)? – Mitya