Possible Duplicate:
Double equals and tripple equals in php
I am trying to test against various types of 'empty' variables that aren't empty. One situation that comes up a lot is
if a string equals "''" (i.e., two single-quote characters) then do xyz, else do abc
I have variables of different types, which may be 0, '0' (i.e, the character '0', ASCII 48, as opposed to the value 0), and "" (the empty string). ALL of these evaluate the same as "''", the string containing two single-quotes. Clearly, they are not the same! One is a string of two characters -- ASCII 39, ASCII 39 -- and the others may be 0, ASCII 48, etc.
I've come up with work-arounds using is_numeric(), etc., but I can't help but thinking there must be a better way. What is the preferred method to handle this sort of thing?
Thanks much for your patience in what must seem to be a very naïve question.