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
- [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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Comparison operators and the truth4m 26s
-
(Locked)
Logical operators5m 55s
-
(Locked)
Creating if/else statements6m 53s
-
(Locked)
Conditional tags in WordPress1m 19s
-
(Locked)
Loops7m 56s
-
(Locked)
The Loop in WordPress2m 54s
-
(Locked)
Challenge: Loop through an array of information1m 18s
-
(Locked)
Solution: Loop through an array of information5m 28s
-
-
-
-