Is that OK?
All the letters of the string and 0 are identical? Ask for explanations
PHP Code
if ("e" = = 0) { echo "Yes";} #result: #Yes
------Solution--------------------
"E" is not a variable in memory, nothing ....
------Solution--------------------
This by:
PHP code
echo "e" = = = 0;
------Solution--------------------
PHP will automatically convert the type of the variable, and the int and string comparisons will then convert the string to int so that all the strings are 0, then the result is OK, you can use = = = Congruent to determine
------solution--------------------
To resolve more clearly:
Echo intval (' e '); #转换不成功, default 0 (print:0)
Echo intval (' 1ds2e '); #字符串中有整数出现, take the first occurrence of the position, convert to int (print:1)
discussion
this way:php c
Ode
echo "e" = = = 0;
------Solution--------------------
This is wrong, "there are integers in the string, then take the first occurrence and convert to int (print:1)"
The
should look like this:
An integer appears in the string, and the integer at the beginning of the string is taken out, converted to an int
discussion
To resolve this more clearly:
Echo intval (' e '); #转换不成功, default 0 (print:0)
Echo intval (' 1ds2e '), #字符串中有整数出现, take first occurrence, convert to int (print:1)
Reference:
This way:php code
echo "e" = = = 0;