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