note 84346 added to function.ob-get-clean
| From: | profix at cms-studio dot net | Date: | Thu, 10 Jul 2008 02:01:53 +0000 |
| Subject: | note 84346 added to function.ob-get-clean | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141342@lists.php.net to get a copy of this message | ||
Maybe it can be useful
$__ob_stack=array();
function ob_break() {
global $__ob_stack;
while (ob_get_level()>0)
array_push($__ob_stack,ob_get_clean());
}
function ob_continue() {
global $__ob_stack;
while (count($__ob_stack)>0) {
ob_start();
echo array_pop($__ob_stack);
}
}
ob_start();
echo "1"; // now we write to "ob" buffer
ob_break();
echo "2"; // now we write to stdout
ob_continue();
echo "3"; // now we write again to "ob" buffer
$output=ob_get_clean();
echo $output;
// output is 213
----
Server IP: 212.24.129.51
Probable Submitter: 89.102.174.174
----
Manual Page -- http://www.php.net/manual/en/function.ob-get-clean.php
Edit -- https://master.php.net/note/edit/84346
Del: integrated -- https://master.php.net/note/delete/84346/integrated
Del: useless -- https://master.php.net/note/delete/84346/useless
Del: bad code -- https://master.php.net/note/delete/84346/bad+code
Del: spam -- https://master.php.net/note/delete/84346/spam
Del: non-english -- https://master.php.net/note/delete/84346/non-english
Del: in docs -- https://master.php.net/note/delete/84346/in+docs
Del: other reasons-- https://master.php.net/note/delete/84346
Reject -- https://master.php.net/note/reject/84346
Search -- https://master.php.net/manage/user-notes.php