Very basic question in PHP - I have set a variable to null, why do I get false in the result?
$a = null;
var_dump(isset($a)); // false
How do I just check if a variable is set if isset
is not the one I am after?
I can't use empty
, for example,
var_dump(empty($b)); // false
But $b
is not set at all.
I can do that in javascript which makes more sense,
if (typeof variable !== 'undefined') ...