Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: ob_clean - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ob_end_clean" width="11" height="7"/> <flush
Last updated: Thu, 31 May 2007

view this page in

ob_clean

(PHP 4 >= 4.2.0, PHP 5)

ob_clean — 出力バッファをクリア(消去)する

説明

void ob_clean ( void )

この関数は、出力バッファの内容を破棄します。

この関数は、ob_end_clean()のように出力バッファ を破棄しません。

ob_flush(), ob_end_flush(), ob_end_clean()も参照ください。



add a note add a note User Contributed Notes
ob_clean
cipri at php dot net
30-Jun-2004 01:54
In Re: to Anonymous at 14-Jan-2003.

You can't mimic the behaviour 100% by using that combination of function calls(ob_end_clean() && ob_start()), since outputhandlers may be defined already by the initial ob_start, which may not work as expected when called twice.
kouber at php dot net
11-May-2004 09:05
Although it is mentioned in the manual, you have to be careful when using output buffering in big cycles (such as mass mail sending scripts), because ob_clean() actually does not free any memory, and with each iteration the amount of memory allocated from your script will increase significantly. Instead of calling ob_clean() at the end of the cycle, you have to either use ob_get_clean(), which is a combination of ob_get_contents() and ob_end_clean(), or just ob_end_clean() to free the memory. Try the following test to see the difference:

<?php
for ($i=0; $i<10; $i++) {
 
ob_start();

  echo
"This is iteration $i: ";

 
// * Don't do this!
  // $buf = ob_get_contents();
  // ob_clean();

  // * Use this instead:
 
$buf = ob_get_clean();

  echo
$buf;
 
  echo
memory_get_usage()."\n";
}
?>
15-Jan-2003 01:23
As far as I can tell the only way to mimic ob_clean()'s behaviour on PHP < 4.2.0 is calling ob_end_clean() followed by ob_start().

ob_end_clean" width="11" height="7"/> <flush
Last updated: Thu, 31 May 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites