Answers for "filter_var boolean returns false"

PHP
1

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
Posted by: Guest on February-19-2021

Code answers related to "filter_var boolean returns false"

Browse Popular Code Answers by Language