PHP readfile() Function – file handling
readfile() function reads a file and writes it to the output buffer.
Assume we have a text file called “blog.eduguru.txt”, stored on the server, that looks like this:
The PHP code to read the file and write it to the output buffer is as follows (the
readfile() function returns the number of bytes read on success):
“Hi, This is a test file. This is created to show the example of readfile function in php.”