On Tuesday 01 July 2003 03:35, Jay Blanchard wrote: > [snip] > > Is there a way I can pipe the output of print_r() into a variable for > further processing? > [/snip] > > $variable = print_r(); > > Then use $variable?
With newer versions of php (check manual) you can specify an extra parameter like so: $output = print_r($some_var, 1) to have it return it's output. If you're using older versions of php then you need to do something like: ob_start(); print_r($some_var); $output = ob_get_contents(); ob_end_flush(); -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Do you mean that you not only want a wrong answer, but a certain wrong answer? -- Tobaben */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php