note 36179 deleted from function.print-r by didou
| From: | didou@php.net | Date: | Tue, 30 Sep 2003 07:44:32 +0000 |
| Subject: | note 36179 deleted from function.print-r by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57385@lists.php.net to get a copy of this message | ||
Note Submitter: stacy@edit-x.com
----
If you ever need to store the print_r() result into a variable here is how...
// print array
function print_array($array) {
ob_start();
$restore = ob_get_contents();
ob_end_clean();
ob_start();
print_r($array);
$output = ob_get_contents();
ob_end_clean();
ob_start();
echo $restore;
return $output;
}
this is useful for debugging functions and classes.
__
R. Stacy Cook
Edit-X :: Control Your Content
http://www.edit-x.com