note 45303 added to reserved.variables

From: Date: Wed, 01 Sep 2004 17:22:23 +0000
Subject: note 45303 added to reserved.variables
Groups: php.notes 
Request: Send a blank email to php-notes+get-75849@lists.php.net to get a copy of this message
Dave Zyga, you can reduce your code to one line by doing the following: <code> extract($_POST); </code> Just a note: I usually don't do this because I want to run validation on my form variables by passing (by reference) the $_POST array to my validator class (where validation is defined against rules for each field). Then when the fields are validated, they are stored in a request object that has a getVar([varname]) and a setVar([varname]) methods for working with the values. So I would access them like this: print "LastName: " . $objRequest->getVar('lname'); print "FirstName: " . $objRequest->getVar('fname); ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+45303 Delete -- http://master.php.net/manage/user-notes.php?action=delete+45303&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+45303&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#75849) next »