Conversion to boolean
The string
'true'
(or 'TRUE'
, 'True'
,
and so on) in a boolean context is converted to boolean true. Any
other string in a boolean context (including 'false'
, '1'
, 'apple'
,
and any other) is converted to boolean false.
'true' (in an input field that requires a boolean) converts to true
'apple' (in an input field that requires a boolean) converts to false