/ Published in: PHP
Print Debug Information (Exibe as informações de depuração)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function pdbg($data, $color="orange", $Line=null, $File=null, $height=180, $width=800) { 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.' '; 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 "</textarea></div>"; print "</div>"; } // Usage: pdbg("you string or var", "yellow", __LINE__,__FILE__,20);