Skip to content

Instantly share code, notes, and snippets.

@t32
Created March 28, 2012 14:38
Show Gist options
  • Save t32/2226706 to your computer and use it in GitHub Desktop.
Save t32/2226706 to your computer and use it in GitHub Desktop.
PHP debug code
<?php
function debug($var) {
echo '<pre>';
if(is_array($var) || is_object($var)) {
print_r($var);
} else {
var_dump($var);
}
echo '</pre>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment