note 18920 deleted from function.print-r by betz
| From: | betz@php.net | Date: | Sun, 18 Jan 2004 15:37:54 +0000 |
| Subject: | note 18920 deleted from function.print-r by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63785@lists.php.net to get a copy of this message | ||
Note Submitter: xeos_dd@hotmail.nospan.com
----
[Ed. Note: As of PHP 4.3.0, you can use the return parameter, instead of output control functions
--alindeman@php.net]
Here's how to use Output buffering with print_r(), and then format it for JScript:
// get the variables
ob_start();
print_r($HTTP_POST_VARS);
$v = ob_get_contents();
ob_end_clean();
// Format them nicely for JS:
$v = str_replace( "\n", "\\n", $v );