Parse the fopen () function in php and use the description of open file mode

Source: Internet
Author: User
This article provides a detailed analysis of the fopen () function in php using the open file mode description. if you need a friend, refer to the fopen () function to open a file in PHP.
The first parameter of this function contains the name of the file to be opened, and the second parameter specifies the mode used to open the file:

 

The file may be opened in the following mode:
R: Read-only. The pointer is located at the beginning of the file. if the file is not reported.
R +: read/write. The pointer is located at the beginning of the file. if the file is not stored, an error is returned.
W: write only. Open and clear the file content. if the file does not exist, create a new file.
W +: read/write. Open and clear the file content. if the file does not exist, create a new file.
A: append. Open the file and locate the pointer at the end of the file. if the file does not exist, create a new file.
A +: Read/append. Open the file and locate the pointer at the end of the file. if the file does not exist, create a new file.
X: Write-only. Create a new file. If the object already exists, FALSE is returned.
X +: read/write. Create a new file. If the file already exists, FALSE and an error are returned.

For more information about parsing the fopen () function in php, refer to the PHP Chinese website!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.