note 41361 added to function.import-request-variables

From: Date: Wed, 07 Apr 2004 17:34:20 +0000
Subject: note 41361 added to function.import-request-variables
Groups: php.notes 
Request: Send a blank email to php-notes+get-67770@lists.php.net to get a copy of this message
import_request_variables() is a convenient function. However, it works for every single variable present in the superglobal. If you wish to make available only a small subset of all variables present in the superglobal then the code fragment below may be of some use. <?php $input_vars = array('var1','var2','var3','var4'); foreach ($input_vars as $var) { if (!empty($_GET[$var])) { $$var = $_GET[$var]; } else { $$var = NULL; } } ?> ---- Manual Page -- http://www.php.net/manual/en/function.import-request-variables.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41361 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41361&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41361&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67770) next »