var_dump()

var_dump()

This is a PHP inbuild function that returns us a value and datatype and length of value or variable.

<?php // Exampal
$var_name1=678;
$var_name2=”a678″;
$var_name3=”678″;
$var_name4=”sometext”;
$var_name5=698.99;
$var_name6=+125689.66;
echo var_dump($var_name1).”<br  />”;
echo var_dump($var_name2).”<br  />”;
echo var_dump($var_name3).”<br  />”;
echo var_dump($var_name4).”<br  />”;
echo var_dump($var_name5).”<br  />”;
echo var_dump($var_name6).”<br  />”;
?>

Output : 
int(678)
string(4) “a678”
string(3) “678”
string(8) “sometext”
float(698.99)
float(125689.66)

Tip

You can use for checking what type of data you recive. Or checking structured information about the object / variable