PHP: finfo_file - Manual

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

search for in the

finfo_open finfo_close

Last updated: Sat, 27 Jan 2007

view this page in

# finfo_file

(PECL)

finfo_file -- Return information about a file

## Описание

string finfo_file ( resource finfo, string file_name [, int options [, resource context]] )
class finfo {
string file ( string file_name [, int options [, resource context]] )
}

This function is used to get information about a file.

## Список параметров

`finfo`

  Fileinfo resource returned by finfo_open().

`file_name`

  Name of a file to be checked.

`options`

  One or disjunction of more Fileinfo constants.

`context`

  For a description of `contexts`, refer to Ссылка CLVII, Stream Functions.

## Возвращаемые значения

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

## Примеры

Пример 1. A finfo_file() example

`<?php
$finfo = finfo_open(FILEINFO_MIME); // return mime type ala mimetype extension
foreach (glob("*") as $filename) {
echo finfo_file($finfo, $filename) . "\n";
}
finfo_close($finfo);
?>`

Результатом выполнения данного примера будет что-то подобное:

    text/html
    image/gif
    application/vnd.ms-excel

## Смотрите также

finfo_buffer()

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

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST