In php, the average is equal to the full expression. in simple terms, it is a simple equivalent. In other words, it is very precise. next I will introduce it to you.
In php, the average value is equal to the total value. in expression test, the value is equal to = and =. in simple terms, the value is a simple value, next, I will introduce the differences and applications between = and =. For more information, see.
In php, the symbols are equal to '=' and all equal to '='. on the surface, they both determine whether the two equal signs are equal, but one is two equal signs, one is the third equal sign.
We should all know that php is a weak type of statement, and its variables and character definitions are not very standard, such as $ a = '4 ′; we can say that $ a is a character, but it can directly perform addition, subtraction, multiplication, division, and division of numbers. In addition, we also know that a single sentence is called a non-zero sign (true, so this sentence is good for the = symbol.
The instance code is as follows:
- If (4! = False) {echo 'OK '},
This judgment is true, and it will output OK. because 4 is not zero, it is true. true is not equal to false. Therefore, if the judgment is true, OK is output, in fact, when determining the comparison, 4 is converted to a Boolean value true due to the object comparison reason. of course, if you use = here, it is also true.
The instance code is as follows:
- If (4! = False) {echo 'OK '}
He will also output OK, because 4 is not false, they are not the same character, but there is a very important difference between the two, that is, = or! = Is converted to the character type because of the object to be compared, and = or! = Is to force him to compare without conversion, for example, the following example:
The instance code is as follows:
- If (0! = False) {echo 'OK '}
This will not output OK, because 0 is false, the judgment is not true, but if you write
The instance code is as follows:
- If (0! = False) {echo 'OK '}
This judgment is true and OK is output, because if 0 is not converted, it is not false, and 0 is 0;
The instance code is as follows:
- If ('4 ′! = 4) {echo 'OK '}
This will not output OK, because after the conversion is equal, the judgment is not true, but if it is
The instance code is as follows:
- If ('4 ′! = 4) {echo 'OK '};
This will output "OK" and "true", because in front of "constant", "4" with single quotation marks and "4" without single quotation marks are not the same "4". one is a number and the other is a character. so it seems that their comparison is very simple. what practical applications do they use. for example:
The instance code is as follows:
- If (strpos ('ABC', 'A ')! = False) {echo 'OK '};
The instance code is as follows:
-