2011年(5)
分类: 系统运维
2011-08-07 21:00:57
(PHP 4, PHP 5)
gettype — 获取变量的类型
返回PHP变量$var的类型。mixed代表该变量可以是任意类型。
千万不要用 gettype() 测试变量类型,因为后续版本会影响到函数返回值。此外,此函数的执行速度太慢了。
可以使用 is_* 函数代替参函数。
Example #1 gettype() example
The above example will output something similar to: