Dump your PHP Variables with var_dump()

To find out the full details of any given variable in PHP, use the handy var_dump() function as follows:

var_dump($variable);

This will show you the PHP variable type, its value, and if it is an object or array. The structure and all information will be output recursively.

The only slight disadvantage to using var_dump() is that the output is sent directly to the browser, with no parameter to control this. If you wish to email the details, for example, you will have to use the PHP output control functions (output buffering).

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *