Last active
August 29, 2015 14:09
-
-
Save niksudan/5f38ae69db512bdb1dc1 to your computer and use it in GitHub Desktop.
Formatted var_dump [PHP]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Formatted var_dump() | |
* | |
* @param variable $var | |
* @param string $title | |
* @return void | |
*/ | |
function pre_var_dump( $var, $title = NULL ) | |
{ | |
?><div class="vardump"><?php | |
if ( $title != NULL ) | |
echo '<h3>' . $title . '</h3>'; | |
?><pre><?php var_dump( $var ) ?></pre></div><?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment