判断php变量是否定义,是否为空
来源:互联网 发布:linux与windows区别 编辑:程序博客网 时间:2024/06/08 06:22
isset() 【1】
Returns TRUE if var exists and has value other than NULL, FALSE otherwise.
输入可以是多个变量,只有所有的变量为真的时候,返回真
empty()【2】
Returns FALSE if var has a non-empty and non-zero value.
The following things are considered to be empty:
- "" (an empty string)
- 0 (0 as an integer)
- "0" (0 as a string)
- NULL
- FALSE
- array() (an empty array)
- var $var; (a variable declared, but without a value in a class)
输入只能是一个变量
is_null() 【3】
Returns TRUE if var is null , FALSE otherwise.
A variable is considered to be null if:
it has been assigned the constant NULL.
it has not been set to any value yet.
it has been unset().
(上表没有找到原始来源,谁知道请告诉我)
如果变量是一个object该如何呢?
表达式 gettype() empty() is_null() isset() if($x) Boolean
参考:
【1】http://php.net/manual/en/function.isset.php
【2】http://www.php.net/manual/en/function.empty.php
【3】http://www.php.net/manual/en/function.is-null.php
- 判断php变量是否定义,是否为空
- 判断php变量是否为空/已定义
- 判断php变量是否为空/已定义
- 判断php变量是否为空/已定义
- php 判断变量是否为空
- PHP 判断变量是否为空
- 判断变量是否为空
- PHP 判断变量是否为空 empty() 函数
- 判断判断Variant变量是否为空
- PHP-变量(一)(变量赋值、判断变量是否为空,变量删除,可变变量等)
- shell判断一个变量是否为空
- perl判断变量是否为空
- shell判断一个变量是否为空
- shell判断一个变量是否为空
- 如何判断shell变量是否为空
- JavaScript判断变量是否为空
- 判断Javascript变量是否为空
- JS 判断变量是否为空
- android:id and id are not same...
- activity contex and memery leak
- Adaboost 训练过程
- FTP命令详解
- 一些免费的HTML编辑器
- 判断php变量是否定义,是否为空
- sql server2005 rownum通用存储过程分页
- Java 插件工程开发的概念
- 明天考试咯
- ASP.NET基础教程-DataGrid表格控件-打印时让表格上下都有自定义页眉和页脚
- ASP.NET基础教程-DataGrid表格控件-打印时让指定每一页的记录数量,并且每页都打印表格的标头
- SQL Server 2005视图解析原理
- Android2.2 官方下载地址
- Linux压缩与解压缩参数说明