Created
September 17, 2011 06:06
-
-
Save robert-wallis/1223678 to your computer and use it in GitHub Desktop.
nicely styled, easy to read, debug($someval, __FILE__.__LINE__); because nobody I know uses zend debugger :(
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 | |
// debug() - Copyright (C) 2006-2009 Robert Wallis | |
// print out the value to be read in the browser | |
if (!function_exists('debug')) | |
{ | |
function debug($value, $name='') | |
{ | |
print('<pre>'); | |
if ($name) | |
print( | |
'<div style="background-color:#313131; color:#FFFFFF; padding: 10px 10px 0px 10px; font-size:16px; font-family: sans-serif;">'.$name.'</div>'. | |
'<div style="background-color:#525252; color:#FF9900; padding: 0px 10px 10px 10px; font-size:13px;">' | |
); | |
else | |
print('<div style="background-color:#525252; color:#FF9900; padding: 10px 10px 10px 10px; font-size:13px;">'); | |
ob_start(); | |
var_dump($value); | |
$output = ob_get_contents(); | |
ob_end_clean(); | |
print(htmlentities($output).'</div></pre>'); | |
} // debug | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment