This question already has an answer here:
- Null vs. False vs. 0 in PHP 18 answers
What is the exact difference between null
, 0
, false
, and an empty string in PHP? Is null
similar to None
in python?
</div>
This question already has an answer here:
What is the exact difference between null
, 0
, false
, and an empty string in PHP? Is null
similar to None
in python?
</div>
Well, after massive comments and then poof deletion of them... may as well try to help you out.
null
is the absence of value.
0
can be a numeric value, or a representation of a boolean FALSE
, or a string. PHP doesn't really have variable typing, so depending on what you are checking for using ==0
or ===0
or ==false
or ===false
may be appropriate.
You may want to read over this - https://www.virendrachandak.com/techtalk/php-isset-vs-empty-vs-is_null/ as well as the PHP manual for isset()
and empty()