Home >Backend Development >PHP Tutorial >Introduction to the usage of var_dump() method in php
This article introduces the usage of the var_dump() method in PHP. Friends in need can refer to it.
An example of var_dump usage is as follows: <?php /** * var_dump用法举例 * edit bbs.it-home.org */ $a = "alsdflasdf;a"; $b = var_dump($a); echo "<br>"; //var_dump($c); $d=var_dump($c); echo "<br>"; echo $a; echo "<br>"; echo $b; echo "<br>"; ?> Output: string(12) "alsdflasdf;a" NULL alsdflasdf;a Instructions: The var_dump() method determines the type and length of a variable and outputs the value of the variable. If the variable has a value, the output is the value of the variable and returns the data type. Displays structural information about one or more expressions, including the expression's type and value. Arrays will expand values recursively, showing their structure through indentation. Format: var_dump ( mixed expression [, mixed expression [, ...]] ) Syntax: var_dump (var,var,bar); Note: Use to ensure that the variable in var_dump must exist. If the variable exists but the value is empty, false is returned; If there is no variable, NULL is returned. This function has an output function, so there is no need to add other output functions. |