note 102008 rejected from reserved.variables.globals by rquadling
| From: | rquadling@php.net | Date: | Sat, 05 Mar 2011 09:47:21 +0000 |
| Subject: | note 102008 rejected from reserved.variables.globals by rquadling | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-177576@lists.php.net to get a copy of this message | ||
Note Submitter: qubsoft at gmail dot com
----
Here's a function which returns an array of all user defined global variables:
<?php
function globals() {
$globals = $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]);
}
return $globals;
}
?>