The result of non-null str0 is true.
Here bool is true .....
Why?
Reply to discussion (solution)
You do
Or
Check the results and analyze them by yourself.
You do
Or
Check the results and analyze them by yourself.
But isn't 0 a null string in php?
Upstairs
I analyzed it like this.
Echo $ str> 0 results empty
Echo $ str <0 results empty
Echo $ str = 0 Result 1
Because $ str is a string and itself is not a number, $ str is indeed false as a number, and false = 0 in php is true.
Refer to my post. when I search for a database, the varchar field uses col = 0 for the search result. if col is null, the search result is correct.
The same is true.
Http://bbs.csdn.net/topics/390529217
Upstairs explanation makes sense
Actually, the conversion is a string. I thought it would convert 0 to a string first !!!!
= During the comparison, the type conversion string and number comparison are performed. if not all values in the string are converted to 0, the comparison result is true. you can try '=' to make the comparison.
Actually, the conversion is a string. I thought it would convert 0 to a string first !!!!
Well, you can't see the experiment.
You do
Or
Check the results and analyze them by yourself.
But isn't 0 a null string in php?
Hey