note 76243 deleted from function.print by nlopess

From: Date: Fri, 13 Jul 2007 19:18:47 +0000
Subject: note 76243 deleted from function.print by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-128475@lists.php.net to get a copy of this message
Note Submitter: Chad ---- This is a simple function for printing debug comments that I didn't think of for a long time. Maybe it'll serve you good too. <?php // by http://www.linksback.org function printd($str) { if ($debug) { echo $str; } } // ... if ($valueCalculatedEarlierInTheScript == 3) { doSomethingWithNoOutput(); printd("doSomethingWithNoOutput() has executed."); } ?> It's mostly just to make sure everything is running without having to go through everything and put in echo "Step #whatever has executed" whenever something mysterious isn't working.

« previous php.notes (#128475) next »