Posted By

iusik on 10/08/10


Tagged

debug


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jplr


debugging (Debugmessage)


 / Published in: PHP
 

  1. function DebugMessage($message, $title = false, $color = "#008B8B")
  2. {
  3. echo '<table border="0" cellpadding="5" cellspacing="0" style="border:1px solid '.$color.';margin:2px;"><tr><td>';
  4. if (strlen($title)>0)
  5. {
  6.  
  7. echo '<p style="color: '.$color.';font-size:11px;font-family:Verdana;">['.$title.']</p>';
  8. }
  9. if (is_array($message) || is_object($message))
  10. {
  11. echo '<pre style="color:'.$color.';font-size:11px;font-family:Verdana;">'; print_r($message); echo '</pre>';
  12. }
  13. else
  14. {
  15. echo '<p style="color:'.$color.';font-size:11px;font-family:Verdana;">'.$message.'</p>';
  16. }
  17. echo '</td></tr></table>';
  18. }

Report this snippet  

You need to login to post a comment.