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
 
<finfo_openmime_content_type>
^Fileinfo FunctionsLast updated: Mon, 26 Oct 2026

finfo_set_flags

finfo::set_flags

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

finfo_set_flags -- finfo::set_flags — Set libmagic configuration options

Description

Procedural style

function finfo_set_flags(finfo $finfo, int $flags): true

Object-oriented style

public function finfo::set_flags(int $flags): true

This function sets various Fileinfo options. Options can be set also directly in finfo_open() or other Fileinfo functions.

Parameters

finfo

An finfo instance, returned by finfo_open().

flags

One or disjunction of more Fileinfo constants.

Return Values

Always returns true.

Changelog

Version Description
8.1.0 The finfo parameter expects an finfo instance now; previously, a resource was expected.

<finfo_openmime_content_type>
^Fileinfo FunctionsLast updated: Mon, 26 Oct 2026