The following small series for everyone to bring a brief talk about the variables in PHP data type judgment function. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
In PHP we can print out the type and value of the variable by Var_dump (). At the same time, we can determine the type of variables through some functions. If you just want the data type of a variable, you can use the GetType () function, GetType ($t) to return the string of the $t data type, and if $t is not part of 8 basic variable types in PHP, return "Unknow type". We can also directly determine whether the type is a function by using the Is_type class function, which returns TRUE, not return false.
Such as:
Is_bool () is Boolean
Is_int () is an integral type
Is_float () is a floating-point type
Is_string () is a string type
Is_array () is an array type
Is_object () is an object type
Is_resource () is a resource type
Is_null () is empty
Is_scalar () is a scalar type, which is an integer floating-point Boolean or String type.
Is_numeric () is any type of numeric or numeric string
Is_callable () is a valid function name
The above is about the variables in PHP data type Judgment function instance code content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!