Re: Variable variables

From: Date: Sat, 28 Aug 2004 19:05:28 +0000
Subject: Re: Variable variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-195024@lists.php.net to get a copy of this message
On Sat, 28 Aug 2004 11:43:13 +0200, JanBro <janbro@web.de> wrote: > Hi List, > > I'm using PHP5 with global variables off. I've got around 20 dynamically > generated forms with a total of 300 different variables sent thru these > forms. I'd like to use variable variables, but according to the manual this > is not possible. > > Now comes my Questoin, how do I receive my variables which have the form > $a_123 or $a_124[]. Is there a workaround for PHP5 or PHP in general? > > Who do I make $data = $_REQUEST['a_123'] work ??? I'd hate to set global > variables to on, as I'm dealing with sensitive data. > Your question makes absolutely no sense. You can do $_REQUEST['a_123'] just fine. If what you want is to loop through them... foreach($_REQUEST as $key => $val) { //.... } or foreach($variableNames as $var) { $_REQUEST[$var] } -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

« previous php.general (#195024) next »