Yes, another NULL vs empty string question.
I agree with the idea that NULL means not set, while empty string means \"a value that is empty\". Here\'s my problem: If the
I have always used NULL
for uninitialized values, empty
for purposely empty values and 0
for off indicators.
By doing this all the time, it is there even if I am not using it, but I don't have to do anything different if I need that distinction.
I am usually testing for empty()
, but sometimes I check for isset()
which evaluates false
on NULL
. This is useful for reminders to answer certain questions. If it is empty
, false
or 0
then the question is answered.