finfo_buffer
(PHP 5 >= 5.3.0, PECL fileinfo >= 0.1.0)
finfo_buffer — 文字列バッファの情報を返す
説明
string finfo_buffer
( resource $finfo
, string $string = NULL
[, int $options = FILEINFO_NONE
[, resource $context = NULL
]] )
finfo
string buffer
( string $string = NULL
[, int $options = FILEINFO_NONE
[, resource $context = NULL
]] )
この関数は、バイナリデータの情報を文字列形式で返すために使用します。
パラメータ
- finfo
-
finfo_open() が返す fileinfo リソース。
- string
-
調べるファイルの内容。
- options
-
ひとつあるいは複数のFileinfo 定数の組み合わせ。
- context
-
返り値
string のテキスト表現、あるいはエラーが発生した場合に FALSE を返します。
例
例1 finfo_buffer() の例
<?php
$finfo = new finfo(FILEINFO_MIME);
echo $finfo->buffer($_POST["script"]) . "\n";
?>
上の例の出力は、 たとえば以下のようになります。
application/x-sh; charset=us-ascii
finfo_buffer
There are no user contributed notes for this page.
