Code: Select all
switch($boolean)
case 0: /* do something for records that have been assigned a 0 value */ break;
case 1: /* do something for records that have been assigned a 1 value */ break;
case NULL: /* do something for records that have not been assigned a value yet */ break;Am I overlooking something, or can I not use a switch?
Edit: I tried explicitly setting $var = NULL and switching on it, and it still equated 0 with NULL, regardless of the order of the case statements.