This article has sorted out the types of data that are common in PHP, and interested friends can refer to the following
PHP data type PHP supports eight original types (type). Four scalar types: string (string) Integer (integer) float (floating-point type, also double) Boolean (Boolean) Two composite types: Array (array) Object (object) Two special types: resource (resources) NULL (empty) View variable types The GetType () function makes it easy to view the type of a variable: copy code code as follows: <?php$var_bool = TRUE; A boolean$var_str = "foo"; a string$var_int = 12; An Integerecho GetType ($var _bool); Output Booleanecho GetType ($var _str); Output Stringecho GetType ($var _int); Output integer?> (ps:t good PHP Q-button 峮: 276167802, Validation: CSL) hint for historical reasons, if it is float type data, the GetType () function returns a D Ouble, not float. If you want to see the value and type of an expression, use the Var_dump () function. Judgment Variable type If you want to determine the next logical action by judging the variable type, do not use GetType (), and use the Is_type series function: Copy the code as follows: <?php$var_i NT = 12;//If $var _int is of type int, this makes addition if (Is_int _int) {$var _int = $var _int+4;} echo $var _int; Output 16?> Above is this article on the PHP data type rollup, I hope this article for the vast number of PHP developers help, thank you for reading thisText