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

search for in the

is_callable> <is_bool
Last updated: Fri, 06 Nov 2009

view this page in

is_buffer

(PHP 6 >= 6.0.0)

is_buffer変数がネイティブ unicode あるいはバイナリ文字列かどうかを調べる

説明

bool is_buffer ( mixed $var )

指定した変数が、ネイティブの unicode あるいはバイナリ文字列かどうかを調べます。

パラメータ

var

調べる変数。

返り値

var がネイティブの unicode あるいはバイナリ文字列である場合に TRUE、それ以外の場合に FALSE を返します。

例1 is_buffer() の例

<?php
// さまざまな型の変数を宣言します
$types = array(
            
'unicode'    => 'Unicode string'
            
'binary'    => b'Binary string'
            
'resource'    => fopen('php://stdin''r'), 
            
'integer'    => 42
            
);

// バッファ内の型を調べます
foreach($types as $type => $value)
{
    if(
is_buffer($value))
    {
        echo 
$type ' is a either a unicode or binary string';
    }
    else
    {
        echo 
$type ' is not a buffer value';
    }

    echo 
PHP_EOL;
}
?>

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

unicode is a either a unicode or binary string
binary is a either a unicode or binary string
resource is not a buffer value
integer is not a buffer value

参考

  • is_binary() - 変数がネイティブバイナリ文字列かどうかを調べる
  • is_string() - 変数の型が文字列かどうかを調べる
  • is_unicode() - 変数が unicode 文字列かどうかを調べる



add a note add a note User Contributed Notes
is_buffer
There are no user contributed notes for this page.

is_callable> <is_bool
Last updated: Fri, 06 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites