Possible Duplicate:
Check if value isset and null
If I have $v = NULL;
how can I check that $v
is exists and it's NULL
?
isset($v) => false //because of NULL, but $v exists
Possible Duplicate:
Check if value isset and null
If I have $v = NULL;
how can I check that $v
is exists and it's NULL
?
isset($v) => false //because of NULL, but $v exists
You can’t, null
is equivalent to a non-existing variable:
A variable is considered to be null if:
- it has been assigned the constant
NULL
.- it has not been set to any value yet.
- it has been
unset()
.
Only for arrays you can check whether a key exists although its value is null
using array_key_exists
.