Source Code:
(back to article)
<?php $condition1 = true; $condition2 = true; if ($condition1 && $condition2) { echo "Both conditions are true\n"; } $condition1 = false; $condition2 = true; if ($condition1 && $condition2) { echo "Both conditions are true\n"; } else { echo "One of the conditions is false\n"; } $condition1 = true; $condition2 = false; if ($condition1 && $condition2) { echo "Both conditions are true\n"; } else { echo "One of the conditions is false\n"; } $condition1 = false; $condition2 = false; if ($condition1 && $condition2) { echo "Both conditions are true\n"; } else { echo "One of the conditions is false\n"; }
Result:
Report an issue