From: kink Date: Wed, 23 Jul 2003 11:23:53 +0000 (+0000) Subject: Extend sm_print_r so you can do: X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=7fe09a30292a999b7710c89b4901e4f0ca1872ae Extend sm_print_r so you can do: sm_print_r($a, $b, $c); git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5401 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/strings.php b/functions/strings.php index ee4fa596..af51b987 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -439,15 +439,18 @@ function makeComposeLink($url, $text = null) } /** -* sm_print_r($some_variable); +* sm_print_r($some_variable, [$some_other_variable [, ...]]); * Debugging function - does the same as print_r, but makes sure special * characters are converted to htmlentities first. This will allow * values like to be displayed. * The output is wrapped in
 and 
tags. */ -function sm_print_r($var) { +function sm_print_r() { ob_start(); // Buffer output - print_r($var); + foreach(func_get_args() as $var) { + print_r($var); + echo "\n"; + } $buffer = ob_get_contents(); // Grab the print_r output ob_end_clean(); // Silently discard the output & stop buffering print "
";