Page 1 of 1

How do you convert object data to a string?

Posted: Tue Sep 27, 2005 12:20 pm
by Ahhhk
Hi!

How would I go about putting an object into a string so it can be emailed?

I'm using Pear DB and when there is an error, I want to email the $result.

I can print_r ($result) to output it to the screen. But, how would I get that same print_r output into a string/variable?

$error_dump = var_dump($result) //outputs to the screen as well :/

Thanks for any help!

Ahhhk!

Posted: Tue Sep 27, 2005 12:22 pm
by feyd

Code: Select all

$str = print_r($someVar,true);
:?

Posted: Tue Sep 27, 2005 12:27 pm
by Ahhhk
Doh!

Is that it? :0

Thanks feyd!