更新时间:2023-11-29 18:24:22
The type of $value1 is "String" NOT "bool".
转换为布尔值时,将考虑以下值否:
When converting to boolean, the following values are considered FALSE:
the boolean FALSE itself
the integer 0 (zero)
the float 0.0 (zero)
the empty string, and the string "0"
an array with zero elements
an object with zero member variables (PHP 4 only)
the special type NULL (including unset variables)
SimpleXML objects created from empty tags
其他所有值均视为TRUE(包括任何资源).
Every other value is considered TRUE (including any resource).
如此,假" ==真!
也许您可以将它们作为字符串进行比较:
maybe you can compare them as string:
if(strtoupper($value[1]) == "TRUE"){
//...
}else{
//...
}