Prerequisite
- Knowledge of basic PHP syntax.
In this tutorial you will learn about
- File Handling
Functions
We will be using 3 predefined functions for file handling
- fopen: To open a file
- file_get_content: To read a file
- fclose: To close a file
Little theory before we begin
Opening a file
Predefined function fopen() is used to open a file. It returns a variable which can be used for accessing the file. Returned variable is called as file handler.
Syntax:
mode: It controls how you want to access a file.
Note: It opens the file only if the logged-in user has permission to open it. If unable to open the file it returns false.
Read the rest of this entry »