finfo_file

finfo_file

(PECL)

finfo_file -- Return information about a file

Description

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.

Parameters

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 Reference CL, Stream Functions.

Return Values

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

Examples

Example 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);
?>

The above example will output something similar to:

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

See Also

finfo_buffer()



Links
HostMonster $5.95/mo
  • 200GB Diskspace
  • 2000GB Bandwidth
  • Host Unlimited Domains
  • SSH Access
  • SSL FTP Stats
  • CGI Ruby Perl PHP MySQL
  • Free Domain

HostGator $9.95/mo
  • 100GB Diskspace
  • 1000GB Bandwidth
  • Host Unlimited Domains
  • CPanel
  • PHP CGI SSH SSI
  • Instant Backups
  • 99.9% Uptime Guarantee
  • 30 Day Money Back

Bluehost $6.95/mo
  • 50GB Diskspace
  • 999GB Bandwidth
  • Host 6 Domains
  • CGI Ruby(RoR) Perl PHP MySQL PostgreSQL
  • Support Custom PHP.INI
  • SSH SSL FTP Stats
  • Free Domain Forever
  • 27/7 Support

Hosting Companies


Partners


Quick Search
Platform

Price

Diskspace

Bandwidth


 Advance Search
 Show All Companies


Reference & Manual

If you are looking for dedicated servers, look no further. HostPulse.com is a site devoted to help web users find cheap web hosting and dedicated servers.


Free Sitemap Generator Host Login/Register | Contact Us | Terms | Add Links
Thumbnails by Thumbshots.org © 2002-2008 CheapHostDir.com