fpassthru

int fpassthru(resource file_handle) 

Prints the remainder of a file.

Returns:

Number of bytes passed

Description:

Reads the remaining contents of a file and prints them to standard output. The file pointer must be valid and is closed after fpassthru() is done. If you just want to dump the contents of a file, readfile() might be a better choice, since it does not require the file to be opened first. fpassthru() is useful for emptying prefilled buffers that need to be flushed to the screen after you’re done analyzing them— for example, when printing remaining packet data from network connections.

Warning:

Because some of the filesystem functions to read/write from files partially share the same code, one or more of the bugs reported ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.