Unsetting global variables within a function?

From: Date: Thu, 01 Jun 2000 16:18:29 +0000
Subject: Unsetting global variables within a function?
Groups: php.general 
Request: Send a blank email to php-general+get-837@lists.php.net to get a copy of this message
I have an HTML form. One of the form actions requires that I clear out all the current form variables so that I can present a new, empty form. I want to unset these variables from within a function. Suppose I have a variable named $date from the form. This does not appear to work: function xxx () { global $date; unset ($date); } On the other hand, this does work: function xxx () { unset ($GLOBALS["date"]); } Just curious why this is. -- Paul DuBois, paul@snake.net

« previous php.general (#837) next »