dump($variable, $echo = true)

Dumps the content of any variable in a human readable way for debugging

  • $variable (mixed)
  • $echo (boolean)
    Whether to echo the dump
  • return (string)

Example


$foo = array(
  'a', 'b', 'c'
);

dump($foo);

/* 
array(
  'a',
  'b',
  'c'
)
*/

// Returns the value
$dump = dump($foo, false);

Is something missing or incorrect? Edit this page on Github…