/ Published in: PHP
For when xDebug is not enabled and you want to echo/dump a variable.
Shorter than:
<pre> var_dump($something); exit;</pre>
if you use the $exit argument.
Also shorter than:
<pre>echo "<pre>"; var_dump($something); echo "</pre>"; exit;</pre>
too.
Shorter than:
<pre> var_dump($something); exit;</pre>
if you use the $exit argument.
Also shorter than:
<pre>echo "<pre>"; var_dump($something); echo "</pre>"; exit;</pre>
too.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function dump($var, $exit = false) { $var = 'string(0) ""'; $var = 'array(0) empty'; $var = 'boolean ' . ((true === $var) ? 'true' : 'false'); } elseif(null === $var) { $var = 'null'; } if(true == $exit) { } }