php filter_var boolean
$bool = filter_var("1", FILTER_VALIDATE_BOOLEAN); // true
$bool = filter_var("true", FILTER_VALIDATE_BOOLEAN); // true
$bool = filter_var("yes", FILTER_VALIDATE_BOOLEAN); // true
$bool = filter_var("on", FILTER_VALIDATE_BOOLEAN); // true
$bool = filter_var("anythingElse", FILTER_VALIDATE_BOOLEAN); // false