Extend sm_print_r so you can do:
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 23 Jul 2003 11:23:53 +0000 (11:23 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 23 Jul 2003 11:23:53 +0000 (11:23 +0000)
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

functions/strings.php

index ee4fa5965a53316537ec4db4a75824337d442531..af51b98745589b3c43d8acdae6e71520e65012ce 100644 (file)
@@ -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 <some@email.address> to be displayed.
 * The output is wrapped in <pre> and </pre> tags.
 */
 * Debugging function - does the same as print_r, but makes sure special
 * characters are converted to htmlentities first.  This will allow
 * values like <some@email.address> to be displayed.
 * The output is wrapped in <pre> and </pre> tags.
 */
-function sm_print_r($var) {
+function sm_print_r() {
     ob_start();  // Buffer output
     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 "<pre>";
     $buffer = ob_get_contents(); // Grab the print_r output
     ob_end_clean();  // Silently discard the output & stop buffering
     print "<pre>";