note 30955 added to language.variables.predefined

From: Date: Fri, 04 Apr 2003 10:06:25 +0000
Subject: note 30955 added to language.variables.predefined
Groups: php.notes 
Request: Send a blank email to php-notes+get-46215@lists.php.net to get a copy of this message
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]); } } -- http://www.php.net/manual/en/language.variables.predefined.php http://master.php.net/manage/user-notes.php?action=edit+30955 http://master.php.net/manage/user-notes.php?action=delete+30955 http://master.php.net/manage/user-notes.php?action=reject+30955

« previous php.notes (#46215) next »