class finfo (View source)

Methods

__construct(int $flags = 0, string $magic_database)

No description

finfo($options, $arg)

No description

bool
set_flags(int $flags)

(PHP >= 5.3.0, PECL fileinfo >= 0.1.0)
Set libmagic configuration options

string|false
file(string $filename, int $flags = FILEINFO_NONE, resource $context = null)

(PHP >= 5.3.0, PECL fileinfo >= 0.1.0)
Return information about a file

string|false
buffer(string $string, int $flags = FILEINFO_NONE, resource $context = null)

(PHP 5 >= 5.3.0, PECL fileinfo >= 0.1.0)
Return information about a string buffer

Details

__construct(int $flags = 0, string $magic_database)

No description

Parameters

int $flags [optional]
string $magic_database [optional]

finfo($options, $arg)

No description

Parameters

$options [optional]
$arg [optional]

bool set_flags(int $flags)

(PHP >= 5.3.0, PECL fileinfo >= 0.1.0)
Set libmagic configuration options

Parameters

int $flags

One or disjunction of more Fileinfo constants.

Return Value

bool

TRUE on success or FALSE on failure.

string|false file(string $filename, int $flags = FILEINFO_NONE, resource $context = null)

(PHP >= 5.3.0, PECL fileinfo >= 0.1.0)
Return information about a file

Parameters

string $filename

Name of a file to be checked.

int $flags

[optional]

One or disjunction of more Fileinfo constants.

resource $context

[optional]

For a description of contexts, refer to .

Return Value

string|false

a textual description of the contents of the filename argument, or FALSE if an error occurred.

string|false buffer(string $string, int $flags = FILEINFO_NONE, resource $context = null)

(PHP 5 >= 5.3.0, PECL fileinfo >= 0.1.0)
Return information about a string buffer

Parameters

string $string

Content of a file to be checked.

int $flags

[optional]

One or disjunction of more Fileinfo constants.

resource $context [optional]

Return Value

string|false

a textual description of the string argument, or FALSE if an error occurred.