Skip to content

Instantly share code, notes, and snippets.

View subodhghulaxe's full-sized avatar

Subodh Ghulaxe subodhghulaxe

View GitHub Profile
@subodhghulaxe
subodhghulaxe / php-debug-function.php
Last active August 29, 2015 14:04
PHP debug function
<?php
/** Debug function */
function db($data) {
$backtrace = debug_backtrace();
$caller = array_shift($backtrace);
echo '<br><pre style="color:#B99AFF;">##### <span style="color:green;">'.$caller['file'].'</span> <span style="color:red;">Line: '.$caller['line']. '</span> #####<br><span style="color:blue;">';
if( !empty($data) ) { print_r( $data ); } else { print_r("Empty variable.<br>"); }
echo '</span>######################################################</pre><br>';
}