Php/docs/function.ob-get-length

提供:Dev Guides
< Php
移動先:案内検索

ob_get_length

(PHP 4 >= 4.0.2, PHP 5, PHP 7)

ob_get_length出力バッファの長さを返す


説明

ob_get_length ( ) : int

この関数は、出力バッファの内容の長さをバイト単位で返します。


返り値

出力バッファの内容の長さをバイト単位で返します。 出力のバッファリングがアクティブでない場合には、false を返します。


例1 単純な ob_get_length() の例

<?phpob_start();echo "Hello ";$len1 = ob_get_length();echo "World";$len2 = ob_get_length();ob_end_clean();echo $len1 . ", " . $len2;?>

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


6, 11

参考