php filter var boolean

Solutions on MaxInterview for php filter var boolean by the best coders in the world

showing results for - "php filter var boolean"
Jonah
27 Oct 2017
1$bool = filter_var("1", FILTER_VALIDATE_BOOLEAN); // true
2$bool = filter_var("true", FILTER_VALIDATE_BOOLEAN); // true
3$bool = filter_var("yes", FILTER_VALIDATE_BOOLEAN); // true
4$bool = filter_var("on", FILTER_VALIDATE_BOOLEAN); // true
5$bool = filter_var("anythingElse", FILTER_VALIDATE_BOOLEAN); // false