php provide all type of file operation. Let us check some of the Basic PHP File Operations like Create a File, Open a File, Write to a File, Append to a File, Close a File, Delete a File, Rename a File, Reading a File Line by Line, Reading a File Character by Character etc..
Before that we can check what are the diffrent mode of opening a file.
w : Open for writing only.
r : Open file for reading only.
r+ : Open file for reading and writing.
w+ : Open file for reading and writing.
a : Open file for writing only.
a+ : Open file for reading and writing.
x : Create and open file for writing only.
x+ : Create and open file for reading and writing.
c : Open the file for writing only. If the file does not exist, it is created. If it exists, it is neither truncated.
c+ : Open the file for reading and writing.
Open a File
Write to a File
Append to a File
Close a File
Delete a File
Rename a File