Forum und email

finfo_buffer

(PECL fileinfo:0.1-1.0.4)

finfo_buffer — 文字列バッファの情報を返す

説明

string finfo_buffer ( resource $finfo , string $string [, int $options [, resource $context ]] )
finfo
string buffer ( string $string [, int $options [, resource $context ]] )

この関数は、バイナリデータの情報を文字列形式で返すために使用します。

パラメータ

finfo

finfo_open() が返す fileinfo リソース。

string

調べるファイルの内容。

options

ひとつあるいは複数のFileinfo 定数の組み合わせ。

context

返り値

string のテキスト表現、あるいはエラーが発生した場合に FALSE を返します。

Example#1 finfo_buffer() の例

<?php
$finfo 
= new finfo(FILEINFO_MIME);
echo 
$finfo->buffer($_POST["script"]) . "\n";
?>

上の例の出力は、たとえば 以下のようになります。

application/x-sh

参考