3 ms·
This won't work. Both 0 (numeric) and '0' (string) == false, but never === false (because when you === you're checking that it's the same type). If you expect
by arenaninja 12y ago
This won't work. Both 0 (numeric) and '0' (string) == false, but never === false (because when you === you're checking that it's the same type).
If you expect a string '0', simply check strlen($str) > 0. If the value could be numeric, use a (string) cast.
- rmrfrmrf 12y agoYou're right; my bad. I'll edit if possible.