note 33992 deleted from function.extract by sniper

From: Date: Sun, 13 Jul 2003 01:57:38 +0000
Subject: note 33992 deleted from function.extract by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-51999@lists.php.net to get a copy of this message
Note Submitter: nospam at thenerdshow dot calm ---- With regard to what's been said, I like to work with variables without a prefix but it is not good to import them all into a global scope. In addition, my preference is to explicitly set all undeclared variables to NULL, but you can change that: $expected=array( 'name', // Only accept these variables from a submit! 'email', 'favorite_color' ); foreach ($expected as $formvar) $$formvar = (isset($_REQUEST[$formvar]))?$_REQUEST[$formvar]:NULL;

« previous php.notes (#51999) next »