note 102568 modified in function.ob-get-clean by danbrown
| From: | danbrown@php.net | Date: | Tue, 22 Feb 2011 11:38:09 +0000 |
| Subject: | note 102568 modified in function.ob-get-clean by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-177211@lists.php.net to get a copy of this message | ||
Also, don't forget that you will need to ob_start() again for any successive calls:
<?php
ob_start();
echo "1";
$content = ob_get_clean();
ob_start(); // This is NECESSARY for the next ob_get_clean() to work as intended.
echo "2";
$content .= ob_get_clean();
echo $content;
?>
Output: 12
Without the second ob_start(), the output is 21 ...
--was--
Also, don't forget that you will need to ob_start() again for any successive calls:
ob_start();
echo "1";
$content = ob_get_clean();
ob_start(); // This is NECESSARY for the next ob_get_clean() to work as intended.
echo "2";
$content .= ob_get_clean();
echo $content;
Output: 12
Without the second ob_start(), the output is 21 ...
http://php.net/manual/en/function.ob-get-clean.php