Var_dump--Information about the print variable describes void
Var_dump(mixed expression [, mixed expression [, ...]])
This function displays structure information about one or more expressions, including the type and value of the expression. The array recursively expands the value and displays its structure by indentation.
tip: to prevent the program from outputting the results directly to the browser, you can use the output control functions to capture the output of this function and save them to a variable such as a string type.
You can compare var_dump () with Print_r ().
Example 1. Var_dump () Example
<pre> <?php $a = array (1, 2, array ("a", "b", "c")); var_dump ($a);
/* 输出: array(3) { [0]=> int(1) [1]=> int(2) [2]=> array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } }
*/
$b = 3.1; $c = TRUE; var_dump($b,$c);
/* 输出: float(3.1) bool(true)
*/ ?> </pre> |
|
Var_dump (PHP)