fopen (Filename,mode,include_path,context)
| 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 open, 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 at the file header and truncating the file size to zero. If the file does not exist, try to create it. |
| "A" |
write 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 at the end of the file. If the file does not exist, try to create it. The |
| "x" |
is created and opened as a write, 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. This and specify o_excl| for the underlying open (2) system call The o_creat tag is equivalent. This option is supported by PHP 4.3.2 and later versions and can only be used on local files. The |
| "x+" |
is created and opened as read-write, 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. This and specify o_excl| for the underlying open (2) system call The o_creat tag is equivalent. This option is supported by PHP 4.3.2 and later versions and can only be used on local files. |
In PHP mode only above the settings of the table, other operations are not valid, such as "RW", "RB", "rw+" and other combinations.
In the PHP regular expression matching function preg_match
The lookup file conforms to cst+8 or cst+08:00 or cst-08:00 through this regular expression cst\d\d{1,2}\d?\d{0,2} can be found.
Regular expressions are commonly used characters that need not be deeply understood, unless a large number of projects require
\d integers, \d characters, + repeats more than once, repeat 0 or 1 times, * Repeat 0 or more times, {n,m} repeats n to M times, [] matches what appears in parentheses.
The limitation of IP is that the maximum value cannot exceed 256, and the regular expression design is based on this principle.
IP: ((25[0-5]|2[0-4]\d|[ 0,1]?\d\d?) \.) {3} (25[0-5]|2[0-4]\d| [0,1]?\d\d?]
e-mail Regular expression: http://blog.csdn.net/fatherican/article/details/8853062
PHP file Operations