<?php $globalvar1=1; $globalvar2=2; function globals() { $globals = $GLOBALS; var_dump($GLOBALS); print_r("<br />Before..."); print_r($globals); foreach (array( 'GLOBALS', '_ENV', 'HTTP_ENV_VARS', '_POST', 'HTTP_POST_VARS', '_GET', 'HTTP_GET_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_SERVER', 'HTTP_SERVER_VARS', '_FILES', 'HTTP_POST_FILES', '_REQUEST' ) as $var) { unset($globals[$var]); } print("<br />After..."); print_r($globals); return $globals; } globals(); ?> array(7) { ["GLOBALS"]=> array(7) { ["GLOBALS"]=> *RECURSION* ["_POST"]=> array(0) { } ["_GET"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["globalvar1"]=> int(1) ["globalvar2"]=> int(2) } ["_POST"]=> array(0) { } ["_GET"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["globalvar1"]=> int(1) ["globalvar2"]=> int(2) } Before...Array ( [GLOBALS] => Array *RECURSION* [_POST] => Array ( ) [_GET] => Array ( ) [_COOKIE] => Array ( ) [_FILES] => Array ( ) [globalvar1] => 1 [globalvar2] => 2 ) After...Array ( [globalvar1] => 1 [globalvar2] => 2 ) Ok I see it now. Thank you all, Ashim.