Re: print_r output to a file
| From: | Ernest E Vogelsinger | Date: | Thu, 07 Nov 2002 11:02:05 +0000 |
| Subject: | Re: print_r output to a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123134@lists.php.net to get a copy of this message | ||
At 11:12 07.11.2002, Kerry Kobashi said:
--------------------[snip]--------------------
>Is there a way to send print_r output to a file?
--------------------[snip]--------------------
rtfm :)
pardon me, but I couldn't resist...
ok, specifically:
http://www.php.net/manual/en/function.print-r.php
Tip: As with anything that outputs its result directly to the browser, you
can use the output-control functions to capture the output of this
function, and save it in a string (for example).
output-control functions: http://www.php.net/manual/en/ref.outcontrol.php
You could, for example:
ob_start();
print_r(your_array);
$result = ob_get_contents();
ob_end_clean();
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/