debugging (Debugmessage)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.