Web Content: Displaying Content of FileTag: file, text Category: PHP Basicpost: 25 Apr 2008 read: 72 Web Content Tips - Part 1: If you want to display contents of a text file on web page, you can use this trick. First, put content type text/plain at header. Then, read file use readfile() PHP function. This is simple sample:
The readfile() function reads a file. it will write its content to the output buffer. In this case, we tell to browser that we want to display as plain text. This force the client to preserve line breaks and carriage returns when rendering the file's contents. |
| | Give Your Opinion | Recommend |
|

