True and False: Binary Terms

The Boolean values of True and False are represented within the Expression Engine as the binary numbers 1 and 0, respectively. In other words, when an expression equates to True, its numeric value is 1. When an expression equates to False, its numeric value is 0.

For this reason, any time you intend to include a Boolean value in your code, you should use the corresponding numerical value instead. In the example below, the numeric value of the (False) statement is 0:

"Apples" = "Oranges"

For the sake of simplicity, this guide still uses the terms True and False throughout, although your expressions will not work unless you substitute 1 and 0 where appropriate.

 

<< Previous: Comparison Operators | Next: Equality ( = ) >>