NULL value represents a variable with no value.
NULL is the only possible value of type null.
A variable is considered to be null if:
it has been assigned the constant
it has not been set to any value yet.
it has been unset().
empty — Determine whether a variable is empty
Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value equals
FALSE. empty() does not generate a warning if the variable does not exist.
var exists and has a non-empty, non-zero value. Otherwise returns
The following things are considered to be empty:
- “” (an empty string)
- 0 (0 as an integer)
- 0.0 (0 as a float)
- “0” (0 as a string)
- array() (an empty array)
- $var; (a variable declared, but without a value)