Blogger Information
Blog 4
fans 0
comment 0
visits 3088
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php变量类型以及检测
syqaily的博客
Original
842 people have browsed it

php有8种变量类型:

int   float   string  boolean  array  object  null  resource

isset()  检测变量是否存在   并且值不为null

变量的默认值是null

变量为null的情况:

  1. 变量未定义或未赋值

  2. 变量赋值为null

  3. 用unset注销之后的变量

得到变量的类型

gettype()     

设置变量的类型:

settype() 

打印变量:

echo  print_r   var_dump

判断是否为某种类型:

is_int   is_float  is_string  is_bool  is_array  is_object  is_resource  is_null


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post