PHP FILTER_VALIDATE_BOOLEAN Filter
Complete PHP Filter Reference Manual
Definition and Usage
The FILTER_VALIDATE_BOOLEAN filter validates a value as a boolean option.
- Name: "boolean"
- ID-number: 258
Possible return values:
- Returns TRUE for "1", "true", "on", and "yes".
- Returns FALSE for "0", "false", "off", and "no".
- Otherwise returns NULL.
Example
The output of the code is shown below:
bool(true)
Complete PHP Filter Reference Manual