当前位置:网站首页>Empty, isset and is of PHP_ Null difference
Empty, isset and is of PHP_ Null difference
2022-06-22 03:52:00 【Healthy brick carrier】
PHP Three functions are provided for testing variable values , Namely isset(),empty(),is_null(), They all return Boolean values , But there are differences .
View through the following table :
| Contrast item | isset() Method | empty() Method | is_null Method |
| ""( An empty string ) | true | ture | false |
| " "( A space ) | true | false | false |
| FALSE | true | true | false |
| TRUE | true | false | false |
| array()( An empty array ) | true | true | false |
| NULL | false | true | true |
| "0"( character string 0) | true | true | false |
| 0( integer 0) | true | true | false |
| 0.0( floating-point ) | true | true | false |
| $a( Unassigned variables ) | false | true | false |
1、isset() Function is used to detect whether a variable has been declared and the value is not NULL, That is, only when the value is not NULL Returns true when
2、empty() It is used to check whether a variable is empty. If there are the following conditions, it returns the true value :
1) An empty string
2)false
3) An empty array
4)NULL
5)0
6)0.0
7)unset The next variable
8) character string 0
3、is_null() Used to determine whether the variable content is null value , The only condition for returning a true value is that the variable is null when , So he is. isset() The inverse function of , It can also be seen from the above table
边栏推荐
- 【第23天】给定一个长度为 n 的数组,返回删除第 X 位元素后的数组 | 数组删除操作
- Tried several report tools, and finally found a report based on Net 6
- 倍福TwinCAT3伺服控制常用功能块的实现
- 未來已來:雲原生時代
- How to randomly assign 1000 to 10 numbers
- 便捷自在掌握,vivo智能遥控功能实现全屋家电控制
- Introduction to Beifu TwinCAT NC PTP
- Threejs realizes the fluctuation hot spot effect, fluctuation mark and fluctuation label display
- Quickly master asp Net authentication framework identity - user registration
- 使用Expanded布局时报错The following assertion was thrown during performLayout
猜你喜欢

SSM住院管理系统

The future has come: cloud primary Era

128 traps - source code analysis

Dynamic planning - Taking stair climbing with minimum cost as an example

MySQL 45 lecture notes (I) execution of an SQL statement

Shutter status management

Direct insertion sort of eight sorts
![[leetcode] 17 backtracking (letter combination of telephone number)](/img/86/e623383ded25677d37bd1c7e98a772.png)
[leetcode] 17 backtracking (letter combination of telephone number)

【BP回归预测】基于matlab GA优化BP回归预测(含优化前的对比)【含Matlab源码 1901期】

在线文本按行批量反转工具
随机推荐
AI writes its own code to let agents evolve! The big model of openai has the flavor of "human thought"
Mysql 45讲学习笔记(四)索引
Fatal NI connect error 12170.报错处理
Flutter performance optimization
How to write a detailed and professional software function test report
力扣:用两个栈实现一个队列
倍福嵌入式控制器PLC各型号介绍
Some journals of C51
read stream 特别注意
Analyzing iceberg merge tasks to resolve data conflicts
svn高效管理怎么实现
Introduction to various models of Beifu embedded controller PLC
[leetcode] 17 backtracking (letter combination of telephone number)
Snappy format parsing
How did we solve the realsense color bias problem?
Blazor University (31)表单 —— 验证
H指数问题
3DE save to Favorites
Threejs realizes the fluctuation hot spot effect, fluctuation mark and fluctuation label display
Float floating point number understanding