PHP var_dump() Function
❮ PHP Variable Handling Reference
Example
Dump information about different variables:
<?php
$a = 32;
echo var_dump($a) . "<br>";
$b = "Hello
world!";
echo var_dump($b) . "<br>";
$c = 32.5;
echo
var_dump($c) . "<br>";
$d = array("red", "green",
"blue");
echo var_dump($d) . "<br>";
$e = array(32, "Hello world!", 32.5, array("red", "green", "blue"));
echo
var_dump($e) . "<br>";
// Dump two variables
echo
var_dump($a, $b) . "<br>";
?>
Try it Yourself »
Definition and Usage
The var_dump() function dumps information about one or more variables. The information holds type and value of the variable(s).
Syntax
var_dump(var1, var2, ...);
Parameter Values
Parameter | Description |
---|---|
var1, var2, ... | Required. Specifies the variable(s) to dump information from |
Technical Details
Return Value: | Nothing |
---|---|
Return Type: | - |
PHP Version: | 4.0+ |
❮ PHP Variable Handling Reference