Submitted by snit-ram (not verified) on Fri, 06/19/2009 - 16:48.
And why should I compare with boolean? To get another boolean?
And if you are casting "x" to int, you are probably doing something wrong.
There are ways to test if a string is numeric. For me, test a variable to know if it's numeric before casting is smarter than casting to NaN, and after that, compare value with NaN.
Why comparing?
And why should I compare with boolean? To get another boolean?
And if you are casting "x" to int, you are probably doing something wrong.
There are ways to test if a string is numeric. For me, test a variable to know if it's numeric before casting is smarter than casting to NaN, and after that, compare value with NaN.
PHP converts values to keep simple comparisions like:
"150" == 150
If you don't know what are you doing, I suggest you study a little bit about the language, or use always ===.
Simple like this.