Opening and loading files are very common programming operations, and fortunately they are not difficult.
Opening a file requires the use of the fopen() function, which gives you access to any file and its contents. Let’s look at its declaration:
Both parameters are strings. Obviously $filename is intuitive; however, $mode is a little bit more complex. Let’s take a look and let me explain what that parameter means.
When you open a file, you can open it for several purposes—the most common are reading and writing. You can also open a file for appending, which means that you can add information only to the end of a file. Table 14.2 shows what the PHP manual has to say about all the possible ...