note 22853 added to function.vsprintf

From: Date: Tue, 02 Jul 2002 10:55:01 +0000
Subject: note 22853 added to function.vsprintf
Groups: php.notes 
Request: Send a blank email to php-notes+get-32497@lists.php.net to get a copy of this message
i wrote a short function that make use of vsprintf. It is useful in first coding/debugging of php scripts, because it is called like a simple printf and it display in italic (you can change it of course ;-) ) every debug messages, making it easy to remove them when your code is ready. here goes : function printd() { $debug_array=func_get_args(); $debug_numargs=func_num_args(); $debug_fmt=$debug_array[0]; for ( $i = 0 ; $i < $debug_numargs ; $i++ ) $debug_array[$i] = $debug_array[$i+1]; $debug_text=vsprintf($debug_fmt, $debug_array); printf("--> debug <i>%s</i>\n", $debug_text); } -- http://www.php.net/manual/en/function.vsprintf.php http://master.php.net/manage/user-notes.php?action=edit+22853 http://master.php.net/manage/user-notes.php?action=delete+22853 http://master.php.net/manage/user-notes.php?action=reject+22853

« previous php.notes (#32497) next »