Advertisement
Guest User

Quick 'n' Dirty - Silent Debugger

a guest
Aug 21st, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. define("MY_IP", "89.23.232.21");
  2.  
  3. function silentDebug($info = NULL, $mixedOutputVar = 'no_value', $dieAfter = NULL, $htmlCommented = TRUE) {
  4.   if($_SERVER['REMOTE_ADDR'] == MY_IP) {
  5.     if($mixedOutputVar != 'no_value') {
  6.       $output = is_array($mixedOutputVar) ? print_r($mixedOutputVar, TRUE) : $mixedOutputVar;
  7.       $output = is_string($output) ? $output : var_export($output, TRUE);
  8.       if($htmlCommented) {
  9.         echo '<!--'.$info.': '.$output.'-->'."\n";
  10.       }else {
  11.         echo $info.': '.$output.'<br />'."\n";
  12.       }
  13.       if($dieAfter) {
  14.         die();
  15.       }
  16.     }
  17.   }
  18.   return;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement