📜  php filter_var boolean - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:34.606000             🧑  作者: Mango

代码示例1
$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