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_get_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_get_contents" width="11" height="7"/> <ob_flush
Last updated: Sun, 23 Sep 2007

view this page in

ob_get_clean

(PHP 4 >= 4.3.0, PHP 5)

ob_get_clean — 現在のバッファの内容を取得し、出力バッファを削除する

説明

string ob_get_clean ( void )

現在のバッファの中身を取得し、出力バッファを削除します。

ob_get_clean() は、基本的に ob_get_contents() および ob_end_clean() を同時に実行するのと同じです。

返り値

出力バッファの内容を返した後で出力のバッファリングを終了します。 出力バッファリングが開始されていない場合は FALSE が返されます。

例 1670. 単純な ob_get_clean() の例

<?php

ob_start
();

echo
"Hello World";

$out = ob_get_clean();
$out = strtolower($out);

var_dump($out);
?>

上の例の出力は以下となります。



string(11) "hello world"


    

参考

ob_get_contents()
ob_start()



add a note add a note User Contributed Notes
ob_get_clean
ludvig dot ericson at gmail dot com
10-Aug-2005 11:10
Notice that the function beneath does not catch errors, so throw in an @ before those ob_* calls
webmaster at ragnarokonline dot de
02-Oct-2003 09:21
Running PHP4 < 4.3.0, you can simply add the following to use the function anyway:

<?php
if (!function_exists("ob_get_clean")) {
    function
ob_get_clean() {
       
$ob_contents = ob_get_contents();
       
ob_end_clean();
        return
$ob_contents;
    }
}
?>

ob_get_contents" width="11" height="7"/> <ob_flush
Last updated: Sun, 23 Sep 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites