Home > Backend Development > PHP Tutorial > php file operations

php file operations

WBOY
Release: 2016-08-08 09:29:00
Original
1065 people have browsed it

model describe
r Open the file as read-only. The file pointer starts at the beginning of the file.
w Open the file for writing only. Delete the contents of the file or create a new file if it does not exist. The file pointer starts at the beginning of the file.
a Open the file for writing only. Existing data in the file will be preserved. The file pointer starts at the end of the file. Create a new file if the file does not exist.
x Create new files as write only. Returns FALSE and an error if the file already exists.
r+ Open the file for reading/writing, and the file pointer starts at the beginning of the file.
w+ Open the file for reading/writing. Delete the file contents or create a new file if it does not exist. The file pointer starts at the beginning of the file.
a+ Open the file for reading/writing. Data already in the file will be retained. The file pointer starts at the end of the file. Create new file if it does not exist.
x+ Create new files for reading/writing. Returns FALSE and an error if the file already exists.

The above introduces the operation of PHP files, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template