note 86615 deleted from function.isset by cmb

From: Date: Sun, 10 Feb 2019 11:25:25 +0000
Subject: note 86615 deleted from function.isset by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210214@lists.php.net to get a copy of this message
Note Submitter: tomek ---- Here's a simple function to test if the variable is set: <?php function is($var) { if (!isset($var)) return false; if ($var!==false) return true; return false; } ?> Now instead of very popular (but invalid in many situations): if (!$var) $var=5; you can write: if (!is($var)) $var=5;

« previous php.notes (#210214) next »