You can use boolval(), but it doesn’t produce correct results for “True” and “False” values. This is the better method:
Category: Boolean
State ? ( ) : ( ) Ternary Operator
True / False
TRUE or FALSE, but both are case-insensitive, so True or False and true or false also work no issue in PHP
Bitwise Operators
PHP Integers Integer size is platform-dependent, safest is to assume a maximum value of about two billion (32 bits signed). 64-bit platforms usually have a maximum value of about 9E18 Unsigned integers are not supported in PHP If PHP encounters a number, or the result of an operation, that is beyond the bounds of the […]