Booleans
This is the simplest type. A boolean expresses a truth value. It
can be either Syntax
To specify a boolean literal, use the constants
<?php Typically, the result of an operator which returns a boolean value is passed on to a control structure.
<?php Converting to booleanTo explicitly convert a value to boolean, use the (bool) or (boolean) casts. However, in most cases the cast is unnecessary, since a value will be automatically converted if an operator, function or control structure requires a boolean argument. See also Type Juggling.
When converting to boolean, the following values are considered
Every other value is considered Warning
-1 is considered
<?php |