Open mode |
Description |
R |
Read-only opens, pointing the file pointer to the file header. |
r+ |
Read-write mode opens, pointing the file pointer to the file header. |
W |
Write-only opens, pointing the file pointer to the file header and truncating the file size to zero. If the file does not exist, try to create it. |
w+ |
Read-write mode opens, pointing the file pointer to the file header and truncating the file size to zero. If the file does not exist, try to create it. |
X |
Creates and opens in writing, pointing the file pointer to the file header. If the file already exists, The fopen () call fails and returns false, and generates an E_warning level error message. If the file does not exist, try to create it. |
x+ |
Creates and opens read-write, pointing the file pointer to the file header. If the file already exists, the fopen (the call fails and returns false, and generates an E_warning level error message.) If the file does not exist, try to create it. |
A |
Write to open, pointing the file pointer to the end of the file. If the file does not exist, try to create it. |
A + |
Read-write mode opens, pointing the file pointer to the end of the file. If the file does not exist, try to create it. |
B |
Opens in binary mode for connection to other modes. If the file system can differentiate between binary Files and text files that you may use. Windows systems can differentiate, while UNIX does not Distinguish. It is recommended to use this option all the time for maximum portability. It is also the default The mode. |
T |
Opens in text mode for use in conjunction with other modes. This mode is only the Windows system An option. It is not a recommended option unless you have used the B option in your code. |
PHP File Operation open mode