php 学习笔记--bool
来源:互联网 发布:网络安全员年薪多少 编辑:程序博客网 时间:2024/06/05 12:48
// 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 无输出。
0 0
- php 学习笔记--bool
- PHP学习笔记:PHP基本语法详解 2.bool型和浮点型和字符串
- 学习笔记——bool值用printf的形式输出
- C++学习笔记4 C++之bool类型
- PHP的bool值
- PHP 类型&bool
- PHP之Bool类型
- php判断bool值
- vector<bool>的学习
- 【php】关于if以及bool
- php学习笔记--php基础
- PHP学习笔记 -- 初识PHP
- python 学习笔记(2)数据类型1 (bool型, 数值类型,lists列表类型)
- Python学习笔记5-字符串、bool、数值操作和数组字典排序
- C++学习笔记(二) bool const 和 #define 结构体内存对齐
- 【从C到C++学习笔记】bool类型/const限定符/#define//结构体对齐
- PHP学习笔记(一)
- php学习笔记:NULL
- 在Linux中让echo命令显示带颜色的字
- Struts框架学习01
- C语言中“指针”作为“函数参数”时的注意事项
- FileReader对象使用
- 使用jqueryMobile的一些问题
- php 学习笔记--bool
- 第11章 对话框
- 九度OJ 1101:计算表达式 (DP)
- 01技术网站汇集
- adb 用法
- 求数组中未出现的最小正整数
- Icocoapods 官方第三方库管理
- ICE学习(八)-异步方法调用AMI
- 112家IT公司薪水一览表