Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<mime_content_typefinfo::buffer>
^FileinfoLast updated: Mon, 26 Oct 2026

The finfo class

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL fileinfo >= 0.1.0)

Introduction

This class provides an object-oriented interface into the fileinfo functions.

Class synopsis

class finfo {
/* Methods */
public function __construct(int $flags = FILEINFO_NONE, ?string $magic_database = null)
public function buffer(string $string, int $flags = FILEINFO_NONE, ?resource $context = null): string|false
public function file(string $filename, int $flags = FILEINFO_NONE, ?resource $context = null): string|false
public function set_flags(int $flags): true
}

Table of Contents


<mime_content_typefinfo::buffer>
^FileinfoLast updated: Mon, 26 Oct 2026