Now let us understand the specific usage
gettype()
gettype will return the following values according to the parameter type
"boolean" (from PHP 4)
"integer"
"double" (if it is float, it will return "double", instead of "float")
"string"
"array"
"object"
"resource" (from PHP 4)
"NULL" (from PHP 4)
"unknown type"
For example:
gettype(' 1'); returns string
and gettype(1); returns integer
is_array()
is_array() is relatively simple to use
If the parameter is an array, it returns true, otherwise it returns false
The usage and returns of several other functions The value is similar to is_array()
It should be noted here that is_numeric() is used to determine whether the variable is a number or a string of numbers
When the parameter of is_numeric() is a number or a string of numbers, it returns true, otherwise it returns false
The above has introduced the common methods of determining variable types in PHP, including the content of variable types. I hope it will be helpful to friends who are interested in PHP tutorials.