We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

gdonald on 09/27/06


Tagged

debug


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

blakeb
taxone81
vali29
hudge
JimiJay
haozi
pixelhandler


php debug


Published in: PHP 


  1. function debug( $var )
  2. {
  3. echo '<pre>';
  4.  
  5. if( is_array( $var ) )
  6. {
  7. eregi_replace( "\t", ' ', print_r( $var ) );
  8. }
  9. else
  10. {
  11. print_r( eregi_replace( "\t", ' ', $var ) );
  12. }
  13.  
  14. echo '</pre>';
  15. }

Report this snippet 

You need to login to post a comment.