// someKey is a boolean true
$array = array('someKey'=>true);
// in the following 'false' string gets converted to a boolean true
if($array['someKey'] != 'false')
echo 'The value of someKey is '.$array['someKey'];
As a result the above will output nothing :)
if($array['someKey'] == 'false')
echo 'The value of someKey is '.$array['someKey'];
And the above will output
The value of someKey is 1
In short true == 'false' is true.
//以上引自php手册。
当 关键字 true 或者 false 在字符串里时,都只代表字符串,不再具有bool值特性。
输出布尔值时,true 已 1 输出; false 无输出。