Locked lesson.
About this lesson
Logic sits at the core of all computer programming. Understanding logic operators in PHP.
Exercise files
Download this lesson’s related exercise files.
Logic Operators.docx58.8 KB Logic Operators - Solution.docx
59 KB
Quick reference
Logic Operators
Logic operators allow us to do logic (and/or).
When to use
Whenever you need to compare more than one thing, use logic operators (and/or).
Instructions
And (&&), Or (||), xor, allow us to compare more than one thing.
and (&&) both true to be true, otherwise false
or (||) one true to be true, otherwise false
xor only one can be true but not both
Hints & tips
- And (&&)
- Or (||)
- xor
Lesson notes are only available for subscribers.