finfo_buffer
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL fileinfo >= 0.1.0)
Return information about a string buffer
Description
Procedural
Oop
This function is used to get information about binary data in a string.
Parameters
finfoFinfo
stringContent of a file to be checked.
flagsOne or disjunction of more Fileinfo constants.
context
Return Values
Returns a textual description of the string argument, or false if an error occurred.
Changelog
| Version | Description |
|---|---|
| 8.5.0 | The context parameter has been deprecated as it is ignored. |
| 8.0.0 | context is nullable now. |
Examples
A finfo_buffer() example
<?php
$finfo = new finfo(FILEINFO_MIME);
echo $finfo->buffer($_POST["script"]) . "\n";
?>The above example will output something similar to:
application/x-sh; charset=us-ascii