Variable type of 1.PHP: Integer floating-point string Boolean Array object null resource type A variable is a box, the type can be seen as the label of the box, the value of the variable is the contents of the box null is no type of empty box, only one value is Null2 . The detection of variables:
The detection of the variable if (isset ($b)) { echo ' variable b exists '; } else{ echo ' variable B does not exist '; }
Isset () is used to detect if a variable is set, returns a Boolean value,
Returns False if the variable is not assigned or the assignment is null, or True if it is not assigned to a value
3. Detection of variable types:
Gets the variable type $ A = 1;echo ' GetType ($a) ';//Determine if the variable is the desired type//Is_int, is_float, is_array ... $a = 23if (Is_int ($a)) { Echo ' A is an integral type '; } else{ Echo ' A is not an integral type '; }
PHP variable type, variable detection