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

search for in the

is_bool> <is_array
Last updated: Fri, 13 Nov 2009

view this page in

is_binary

(PHP 6 >= 6.0.0)

is_binary変数がネイティブバイナリ文字列かどうかを調べる

説明

bool is_binary ( mixed $var )

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

パラメータ

var

調べる変数。

返り値

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

例1 is_binary() の例

<?php
// unicode 文字列を宣言します
$unicode 'This is a unicode string';

// バイナリ文字列を宣言するには先頭に 'b' をつけます。
// これは PHP 5.2.1 以降で使用可能ですが、実際に動作するようになるのは
// PHP 6.0.0 以降です。
$binary b'This is a binary string';

var_dump(is_binary($unicode), is_binary($binary));
?>

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

bool(false)
bool(true)

参考

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



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

is_bool> <is_array
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites