FILTER_VALIDATE_BOOLEAN filter validates values as Boolean options.
Name: "boolean"
ID-number: 258
Possible return values:
Returns TRUE if "1", "true", "on", and "yes".
Returns FALSE if "0", "false", "off", and "no".
Otherwise return NULL.
<?php$var="yes";var_dump(filter_var($var, FILTER_VALIDATE_BOOLEAN));?>
The output of the code looks like this:
bool(true)