Home > Article > Backend Development > PHP var_dump()_PHP Tutorial
The php var_dump function is to determine the type and length of a variable, and output the value of the variable. If the variable has a value, the value of the variable is lost and the data type is returned. This function displays structural information about one or more expressions, including expressions The type and value of the formula. Arrays will expand values recursively, showing their structure through indentation.
Its format: var_dump ( mixed expression [, mixed expression [, ...]] )
Let’s take a look at var_dump syntax:
var_dump (var,var,bar);
Let’s take a look at an example I just gave.
$ta =1;
$tb ='t';
echo var_dump($ta,$tb);
?>
The output is
int(1) string(1) “t”
The first number is int(1)
It's simple, but one thing to note is that the variables in var_dump must exist. If the variable exists but the value is empty, false will be returned; if there is no variable, NULL will be returned.