Php Basics -- var_dump function var_dump (PHP3 & gt; 3.0.5, PHP4) var_dump? --? Print the void of the variable description? Var_dump? (Mixedexpression [, mixedexpression [,...]) This function displays the structure information about one or more expressions, including the expression type and value. php Basics-var_dump function usage
Var_dump
(PHP 3> = 3.0.5, PHP 4)
Var_dump? --? Print information about variables
Description void?Var_dump? (Mixed expression [, mixed expression [,...])
This function displays the structure information about one or more expressions, including the expression type and value. The array recursively expands the value and displays its structure through indentation.
Tip :?To prevent the program from directly outputting the results to the browser, you can use the output-controlfunctions function to capture the output of the function and save them to?String? Type.
Can you compare them?Var_dump ()? And?Print_r ().
?
|
Example 1 .?Var_dump ()? Example
$? = Array (1 ,? 2, array ("",? "B ",? "C ")); Var_dump? ($ );
/* Output: Array (3 ){ ?? [0] => ?? Int (1) ?? [1] => ?? Int (2) ?? [2] => ?? Array (3 ){ ???? [0] => ???? String (1) "" ???? [1] => ???? String (1) "B" ???? [2] => ???? String (1) "c" ??} }
*/
$ B? =? 3.1; $ C? =? TRUE; Var_dump ($ B, $ c );
/* Output: Float (3.1) Bool (true)
*/ ?>
|
|