note 33992 added to function.extract
| From: | nospam at rack1 dot php dot net | Date: | Sat, 12 Jul 2003 23:53:46 +0000 |
| Subject: | note 33992 added to function.extract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51996@lists.php.net to get a copy of this message | ||
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;
----
Manual Page -- http://www.php.net/manual/en/function.extract.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33992
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33992&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33992&report=yes