课程: PHP for WordPress (2020)

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Logical operators

Logical operators

- [Instructor] Comparison operators are just one side of the Boolean statements' coin. The other side of that coin is logical operators. Logical operators allow us to combine comparison statements and evaluate the overall truthfulness. So no matter how many statements you combine and compare, the logical operators will always result in a single Boolean value. The first logical operator is AND, and that's represented by two and signs. You can have several different outcomes for this. But if you're combining two statements, and they're both true, so you have true and true, that entire statement is going to evaluate to true. For example, if I say the sky is blue AND the sun is yellow, that is a true statement overall. But if we have a true and a false statement, we say true AND false, that's going to evaluate to false. For example, the sky is blue AND the grass is pink. Only one part of that statement is true and so the overall…

内容