PHP Tutorial
PHP Boolean
Boolean is a data type that can be represented by either true
or false
.
A boolean can be used with conditional statements to determine whether a statement should be executed.
PHP Booelan Example
Boolean Conversion
using (bool)
or (boolean)
you can explicitly convert other data types to boolean.
PHP Booelan Conversion Example
Logical NOT(!)
The logical NOT(!
) used with logical values takes a truthy value turns it to false and vice versa.
PHP Boolean Logical NOT Example
What You Should Know at The End of this Lesson
- You should know about the boolean data type.
- You should know how to convert other data types to boolean.
- You should know how to use the logical NOT to invert logical values.