PHP displays boolean values ββas 1 (true) or an empty string (false) in the output.
If you want to check if it uses true
or false
==
(if the implicit conversion is ok) or ===
(if it isn't). For instance:
echo $val ? 'true' : 'false'; // implicit conversion echo $val === true ? 'true' : 'false'; // no conversion
I do not know how to make PHP output booleans initially as true
or false
.
source share