Share on Google+Share on Google+

PHP var_dump function

PHP var_dump function - In this tutorial gives you an overview of var_dump(), its general format, & two examples. With the help of examples you can understand the functionality of var_dump() Function using PHP.

PHP var_dump Function

The PHP var_dump() function displays information about one or more than one expressions in structured way that includes its type and  value.

General format of var_dump() in PHP is:

void var_dump(mixed  $exp [, mixed $exp [,mixed $exp[,..]]])

where mixed means  a parameter may accept multiple (almost ) types.

and $exp the variable you want to export


PHP Var_dump Function Example 1:






array(5) {

[0]=> int(1) [1]=> int(2) [2]=> string(1) "c" [3]=> bool(true) [4]=> array(4) {

[0]=> string(1) "a"  [1]=> string(1) "b"  [2]=> string(1) "c"  [3]=> array(2) {

 [0]=> float(3.5) [1]=> float(5.5) }




Example 2:



















Posted on: October 12, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.