note 54329 deleted from function.empty by didou
| From: | didou@php.net | Date: | Sun, 18 May 2008 01:01:01 +0000 |
| Subject: | note 54329 deleted from function.empty by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139493@lists.php.net to get a copy of this message | ||
Note Submitter: nsetzer at allspammustdie dot physics dot umd dot edu
----
I needed to know if the variable was empty, but allow for it to be zero, so I created this function.
I post it here in case anybody else needs to do that (it's not hard to make, but why reinvent
the wheel...)
<?php
function is_extant($var)
{
if (isset($var))
{
if ( empty($var) && ($var !== 0) && ($var !== '0') )
return FALSE;
else
return TRUE;
}
else
return FALSE;
}
?>