Return to Snippet

Revision: 51573
at September 28, 2011 16:53 by cdohost


Initial Code
function pdbg($data, $color="orange", $Line=null, $File=null, $height=180, $width=800) 
{
	$dbg = debug_backtrace();
	print "<div style=\"width:".$width."px;float:left;margin:5px\">";
	print "<div style=\"border:1px solid #999;font-size:11px;\">";
	print "<div style=\"background-color:".$color.";padding:2px 5px;font-weight:bold;border-bottom:1px solid #999;\">";
	print $File;
	if($Line) print', LINE: '.$Line.' ';
	$offset = (isset($dbg[1])) ? 1:0;
	if($offset>0)
	print $dbg[$offset]["class"].$dbg[$offset]["type"].$dbg[$offset]["function"]."(".count( $dbg[$offset]["args"]).")";
	print "</div>";
	print "<textarea style=\"width:100%;height:".$height."px;border:none;padding:0 0 0 5px;font-size:11px\">";
	print_r($data);
	print "</textarea></div>";
	print "</div>";
}

// Usage: pdbg("you string or var", "yellow", __LINE__,__FILE__,20);

Initial URL

                                

Initial Description
Print Debug Information (Exibe as informações de depuração)

Initial Title
PHP - Print Debug Information

Initial Tags
php, debug

Initial Language
PHP