Could you please explain why the following 'if' statement is true.
if ('x' == 0) echo "True";
Something like this caused a nasty bug that took a while to track down.
4.0.6
Thanks
If you do
'x' == 0
they are both different types. So what PHP does is this:
double('x') == double(0)
and double('x') is 0, so it becomes
0 == 0
which is true.
When comparing strings, you should use ===, instead of just ==
Diego