Re: Clearing a variable
| From: | Sterling Hughes | Date: | Thu, 18 Jan 2001 22:44:46 +0000 |
| Subject: | Re: Clearing a variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35484@lists.php.net to get a copy of this message | ||
> On Thu, 18 Jan 2001, Brandon Orther wrote:
>
> > Hello,
> >
> > How can I clear a variable?
> >
> > Thank you,
> >
> > --------------------------------------------
> > Brandon Orther
> > WebIntellects Design/Development Manager
> > brandon@webintellects.com
> > 800-994-6364
> > www.webintellects.com
> > --------------------------------------------
> >
>
> unset($var);
>
Actually, just to clarify, that removes a variable from the symbol table.
to clear the contents of a variable, just set it to null:
$var = NULL;
// $var is now empty
-sterling