Definiition :
The PHP fpassthru() function reads from the current position in a file until EOF, and then writes the result to the output buffer.
Call rewind() to reset the file pointer to the beginning of the file if you have already written data to the file.
To dump the contents of a file to the output buffer, without first modifying it or seeking to a particular offset, you may want to use the readfile().
Note: When using this function on a binary file on Windows systems, the file should be opened in binary mode.
fpassthru(file)
Parameter | Description |
---|---|
file | Required. Specifies the open file to read from |
Lets assume that we have a file called demo.txt. This file contains following content:
Output : this another line of this file.31