0== ' is set up I do understand that
0== ' ABC ' also set up don't understand, please advise!
Reply content:
0== ' is set up I do understand that
0== ' ABC ' also set up don't understand, please advise!
Aha, the first two days just looked at the relevant article, this is because you are a number and a string to compare, PHP will convert the string into a number and then compare .
The rules for PHP conversion are: If the string starts with a number, the first number is taken as the result of the conversion, and if none is output 0.
For example: 123abc
after the conversion should be 123
, and abc
then, of 0
0==0
course, this is set up!
Refer to the Official manual: If you compare an integer and a string, the string is converted to an integer.
PS: @gaosboy is a '00'=='000'
comparison of two strings, and the official manual is explained.
$a = ' abc '; $b = (int) $a; echo $b; if (0 = = $b) { //set}
Execute it and you'll know.
See here, think it is time to take a closer look at the PHP manual ~ ~ ~
Test everyone, do not do testing, directly say Var_dump (' ABCDE ') of the print results is what