The functions that output data types in PHP are: 1. var_dump(), prints the data type and value of the variable; 2. gettype(), returns the data type string of the variable.
Functions that output data types in PHP
The functions that output data types in PHP mainly include the following two:
1. var_dump()
var_dump() function prints the data type and value of the variable on the screen. It provides detailed information about the variable type, size, and value.
Syntax:
1 |
|
For example:
1 2 3 4 |
|
Output:
1 |
|
2. gettype()
gettype() function returns the data type of the variable. It returns the data type in string form.
Grammar:
1 |
|
For example:
1 2 3 4 |
|
The above is the detailed content of What data types can be output in php?. For more information, please follow other related articles on the PHP Chinese website!