Re: Unsetting multiple globals?
| From: | Matthew Vos | Date: | Tue, 27 Jan 2004 21:04:50 +0000 |
| Subject: | Re: Unsetting multiple globals? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175977@lists.php.net to get a copy of this message | ||
2 ways to do it:
Simple, no control:
foreach($GLOBALS as $key => $value) unset($GLOBALS[$key]);
Or
$vars_to_clear =
array("1","2","3","4","a","b","C1","D2");
foreach($vars_to_clear as $keyname) unset($GLOBALS[$keyname]);
Matt
On Tue, 2004-01-27 at 15:26, BOOT wrote:
> Hello.
>
> I can unset multiple variables easily, however I can't see how to unset
> multiple globals without:
>
> unset($GLOBALS['1']);
>
> unset($GLOBALS['2'])
>
> unset($GLOBALS['3'])
>
> and so forth
>
> I have tried a few variations with no success.
>
> Thanks for any help!
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc