Opening and Closing Files
Files must be opened before reading or writing.
The fopen() function opens a file and returns a file handle.
Example
Section titled “Example”$file = fopen("example.txt", "r");
fclose($file);Common Modes
Section titled “Common Modes”r– read onlyw– write (overwrite)a– appendr+– read and write