PHP finfo_buffer() Function Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The finfo_buffer() is an inbuilt function in PHP that returns information about a string buffer. Syntax: Procedural Style: string | false finfo_uffer( string $string, int $flags = FILEINFO_NONE, ?resource $context = null )Object-Oriented Style: public finfo::buffer( string $string, int $flags = FILEINFO_NONE, ?resource $context = null ): string | false Parameters: This function accepts three parameters that are described below: string: It contains the content of a file that to be checked.flags: It contains one or disjunction of more Fileinfo constants.finfo: It contains a finfo instance that is returned by finfo_open() function.Return Value: This function returns a textual description of the string argument, otherwise, it will return false. Example 1: This example describes the finfo_buffer() function. PHP <?php $finfo = new finfo(FILEINFO_MIME); echo $finfo->buffer("./index.php") . "\n"; ?> Output: text/plain; charset=us-ascii Example 2: This example describes the finfo_buffer() function. PHP <?php $finfo = new finfo(FILEINFO_MIME); echo finfo_buffer($finfo,"./index.php") . "\n"; ?> Output: text/plain; charset=us-ascii Reference: https://www.php.net/manual/en/function.finfo-buffer.php Comment More infoAdvertise with us Next Article PHP | fgets( ) Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-Fileinfo Similar Reads PHP finfo_file() Function The finfo_file() function is an inbuilt function in PHP that is used for getting information about a file. Syntax: Procedural Style: public finfo_file( string $filename, int $flags = FILEINFO_NONE, ?resource $context = null ): string|false Object-Oriented Style: public finfo::file( string $filename, 2 min read PHP finfo_close() Function The finfo_close() function is an inbuilt function in PHP that is used to close the file instance that is opened by the finfo_open() function. Syntax: finfo_close($finfo):Â boolParameters: This function accepts only one parameter which is described below. $finfo: The file info resource returned by fin 2 min read PHP finfo_open() Function The finfo_open() function is an inbuilt function in PHP that creates a new info instance. This function is in PHP 7 and 8. Syntax: Procedural Style:finfo_open(Flag, magic_database = null)Object-Oriented Style:public finfo::__construct(Flag, $magic_database = null)Parameters: This function has only t 1 min read PHP fscanf() Function The fscanf() function is an inbuilt function in PHP that parses the file's input according to format, i.e., it accepts the input from a file that is associated with the stream & the input will be interpreted according to the specified format. This function is similar to sscanf() function. Any wh 2 min read PHP | fgets( ) Function The fgets() function in PHP is an inbuilt function which is used to return a line from an open file. It is used to return a line from a file pointer and it stops returning at a specified length, on end of file(EOF) or on a new line, whichever comes first. The file to be read and the number of bytes 2 min read PHP | fseek( ) Function The fseek() function in PHP is an inbuilt function which is used to seek in an open file. It moves the file pointer from its current position to a new position, forward or backward specified by the number of bytes. The file and the offset are sent as parameters to the fseek() function and it returns 2 min read Like