note 30955 deleted from language.variables.predefined by curt
| From: | curt@php.net | Date: | Tue, 06 Jul 2004 03:04:50 +0000 |
| Subject: | note 30955 deleted from language.variables.predefined by curt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72661@lists.php.net to get a copy of this message | ||
Note Submitter: Edward Akerboom
----
I found Debabratak's remark on converting the superarrays back into ordinary variables to be
able to keep on coding 'the old way' extremely useful. However, PHP printed a warning each
time his code was executed. Therefore, I have altered it slightly, in order to suppress this
warning.
Here's the code, I hope you find it useful.
------------
session_start();
$ArrayList = array("_GET", "_POST", "_SESSION", "_COOKIE",
"_SERVER");
foreach($ArrayList as $gblArray)
{
$keys = array_keys($$gblArray);
foreach($keys as $key)
{
@$$key = trim(${$gblArray}[$key]);
}
}