The following is a summary of the linux script judgment conditions (mandatory ). I think this is quite good. now I will share it with you and give you a reference. Let's take a look at the following:
-B file: If the file exists and is a special block file, it is true.
-C file: If the file exists and is a special character file, it is true.
-D file: If the file exists and is a directory, it is true.
-E file: true if the file exists
-F file: If the file exists and is a rule file, it is true.
-G file: If the file exists and the value of SGID is set, it is true.
-H file: true if the file exists and is a compliant link
-K file: If the file exists and the "sticky" bit value is set
-P file: If the file exists and is a named pipe, it is true.
-R file: true if the file exists and is readable
-S file: true if the file exists and its size is greater than zero
-U file: true if the file exists and the SUID bit is set
-W file: true if the file exists and can be written
-X file: true if the file exists and is executable
-O file: true if the file exists and is owned by a valid user ID
-Z string if the string length is 0, it is true
-N string: true if the string length is not 0
String1 = string2 if the two strings are equal, it is true.
String1! = String2: true if two strings are not equal
Int1-eq int2 if int1 is equal to int2, true
Int1-ne int2: true if int1 is not equal to int2
Int1-lt int2 if int1 is smaller than int2, true
Int1-le int2 if int1 is smaller than or equal to int2, true
Int1-gt int2 if int1 is greater than int2, true
Int1-ge int2 if int1 is greater than or equal to int2, true
! If expr is false, the composite expression is true. Expr can be any valid test expression
Expr1-a expr2 if both expr1 and expr2 are true, the entire formula is true.
Expr1-o expr2 if either expr1 or expr2 is true, the entire formula is true.
The above summary of the linux script judgment conditions (mandatory) is all the content shared by the editor. I hope to give you a reference and support for PHP.
For more articles about linux script judgment conditions (mandatory), refer to PHP!