note 31180 deleted from function.print-r by alindeman
| From: | alindeman@php.net | Date: | Sat, 12 Apr 2003 16:24:40 +0000 |
| Subject: | note 31180 deleted from function.print-r by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-46544@lists.php.net to get a copy of this message | ||
Starting in PHP 4.3.0, print_r takes a second boolean argument that specifies whether the output is
printed out directly (the old behaviour) or returned. This isn't documented anywhere
('cept in the source code).
This means that in 4.3.0+ you can say:
$foo = array(1, 2, 3);
$foo_dump = print_r($foo, true);
whereas before 4.3.0 you had to use ob_start(), etc to capture the output.