CIII. 变量函数库

介绍

关于变量表现形式的信息请查看本手册 语言参考 部分的 变量 条目。

需求

无需外部库文件就可以加入本扩展模块的支持。

安装

这些函数作为 PHP 核心的一部分,无需被安装即可使用。

运行时配置

这些函数的行为受到全局配置文件 php.ini 的影响。

表格 1. 变量配置选项

名称默认值作用范围
unserialize_callback_func""PHP_INI_ALL
更多关于常量 PHP_INI_* 的细节和解释参见 ini_set()

下边是配置命令的简短说明。

unserialize_callback_func string

如果反序列器发现有未定义类要被实例化,将会调用反序列回调函数(使用未定义类作为参数)。如果指定函数不存在,或者此函数没有包含/执行该未定义类,则显示警告。所以只有在你确实想要执行这样的回调函数时才设置该选项。

参见 unserialize()

资源类型

该扩展模块未定义任何资源类型。

预定义常量

该扩展模块未定义任何常量。

目录
doubleval -- floatval() 的别名
empty -- 检查一个变量是否已置值
floatval -- Get float value of a variable
get_defined_vars --  Returns an array of all defined variables
get_resource_type --  Returns the resource type
gettype -- Get the type of a variable
import_request_variables -- Import GET/POST/Cookie variables into the global scope
intval -- Get integer value of a variable
is_array -- Finds whether a variable is an array
is_bool --  Finds out whether a variable is a boolean
is_callable --  Find out whether the argument is a valid callable construct
is_double -- Alias of is_float()
is_float -- Finds whether a variable is a float
is_int -- Find whether a variable is an integer
is_integer -- Alias of is_int()
is_long -- Alias of is_int()
is_null --  Finds whether a variable is NULL
is_numeric --  Finds whether a variable is a number or a numeric string
is_object -- Finds whether a variable is an object
is_real -- Alias of is_float()
is_resource --  Finds whether a variable is a resource
is_scalar --  Finds whether a variable is a scalar
is_string -- Finds whether a variable is a string
isset -- Determine whether a variable is set
print_r --  Prints human-readable information about a variable
serialize --  Generates a storable representation of a value
settype -- Set the type of a variable
strval -- Get string value of a variable
unserialize --  Creates a PHP value from a stored representation
unset -- Unset a given variable
var_dump -- Dumps information about a variable
var_export -- Outputs or returns a string representation of a variable