Fpassthru-output all remaining data file pointers
Fpassthru
(PHP 4 and PHP 5)
Fpassthru-output all remaining data file pointers
Description
International fpassthru (resource $ processing)
The specific file pointer that reads the EOF analysis is written from the current position and result to the output buffer.
You may need to reset the file starting with the file pointer with () If you have written data files.
If you only want to dump the output buffer of the file content without first modifying or seeking for a specific offset, you may want to use readfile () to save your fopen () function calls.
Parameters
Handle
The file pointer must be valid and must point to a file that successfully opens fopen () or fsockopen () (and has not closed fclose ()).
Return Value
If an error occurs, fpassthru () returns FALSE. Otherwise, the number of characters returned by fpassthru () is read and output.
Instance
For example, #1 uses fpassthru () and binary files
// Open the file in a binary mode
$ Name = './img/OK .png ';
$ Fp = fopen ($ name, 'rb ');
// Send the right headers
Header ("Content-Type: image/png ");
Header ("Content-Length:". filesize ($ name ));
// Dump the picture and stop the script
Fpassthru ($ fp );
Exit;
?>