1.php conversion data type methods are cast and function-converted:
Casting is simply preceded by the variable with the type name enclosed in parentheses.
A functional conversion is a bool Settype (mixed var, string type). The parameter var is the specified variable; The parameter type is the specified data type. The parameter type has 7 optional values, Boolean,float,integer,array,null,object and string. If the conversion succeeds, the Settype function returns True, otherwise false. When a string is converted to an integer or float, if the string starts with a number, the numeric part is converted to shaping, and the subsequent string is removed, and if the number contains a decimal point, it is taken to the previous decimal place.
2. Detection data type:
Is_bool: Detecting whether a variable is a Boolean type
Is_string: Detecting whether a variable is a string type
Is_float/is_double: Detects if a variable is a floating-point type
Is_integer/is_int: Detects if the variable is shaping
Is_null: Detecting whether a variable is a null value
Is_arrary: Detects if a variable is an array
Is_object: Detects if a variable is an object type
Is_numeric: Detects whether a variable is a number or a string consisting of a number
PHP, converting data types, judging data types