In PHP, the var_dump()
function is one function that displays information about a variable or arrays. The information displayed includes the type of the variable and its value.
In the case of arrays, each element’s type and value is displayed, and in the case of arrays with arrays, the arrays are recursively explored to provide their details.
void var_dump($value_1, ...$value_n);
$value
: The variable whose information is to be dumped.Multiple $value
parameters can also be passed.
The return type is void
. This means no value is returned.
<?php// an array$a = array(1, 2, array("first", "second", "third"));// string$b = "I am a string value";//integer$c = 58;var_dump($a,$b,$c);?>
string
is displayed along with the length of the string and the string value itself.58
and its int
type are shown.