finfo_openfinfo::__constructCreate a new fileinfo resource DescriptionProcedural style
resource finfo_open
([ int
$options = FILEINFO_NONE
[, string $magic_file = NULL
]] )Object oriented style (constructor):
public finfo::__construct
([ int
$options = FILEINFO_NONE
[, string $magic_file = NULL
]] )This function opens a magic database and returns its resource. Parameters
Return Values
(Procedural style only)
Returns a magic database resource on success or NotesWarning
The expected magic database format changed in PHP 5.3.11 and 5.4.1. Due to this, the internal magic database was upgraded. This mostly effects code where an external magic database is used: reading an older magic file will now fail. Also, some textual representations of the mime types has changed, for instance for PHP would be "PHP script, ASCII text" instead of "PHP script text" returned.
ExamplesExample #1 Object oriented style
<?php Example #2 Procedural style
<?php The above example will output: text/plain; charset=us-ascii See Also
|