From 6b370c7778859744119ab90754ba2a1951e18d4e Mon Sep 17 00:00:00 2001 From: Andy Lindeman Date: Sat, 12 Apr 2003 16:22:43 +0000 Subject: [PATCH] adding return argument git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@123214 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/var/functions/print-r.xml | 39 ++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/reference/var/functions/print-r.xml b/reference/var/functions/print-r.xml index 6189f69991..b175c2d9fb 100644 --- a/reference/var/functions/print-r.xml +++ b/reference/var/functions/print-r.xml @@ -1,5 +1,5 @@ - + @@ -13,7 +13,13 @@ boolprint_r mixedexpression + boolreturn + + + The return parameter was added in PHP 4.3.0 + + print_r displays information about a variable in a way that's readable by humans. If given a string, @@ -27,7 +33,6 @@ pointer to the end. Use reset to bring it back to beginning. - &tip.ob-capture; @@ -60,8 +65,34 @@ Array ) ]]> - - + + + + If you would like to capture the output of print_r, + use the return parameter. If this parameter is set + to &true;, print_r will return its output, instead of + printing it (which it does by default). + + + + <parameter>return</parameter> parameter example + + 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); + $results = print_r ($b, true); //$results now contains output from print_r +?> +]]> + + + + + + If you need to capture the output of print_r with a + version of PHP prior to 4.3.0, use the + output-control functions. + + Prior to PHP 4.0.4, print_r will continue forever