From the course: PHP for WordPress

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Logical operators

Logical operators - PHP Tutorial

From the course: PHP for WordPress

Start my 1-month free trial

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…

Contents