Re: new to PHP...have some questions

From: Date: Wed, 03 Apr 2002 16:32:51 +0000
Subject: Re: new to PHP...have some questions
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-12919@lists.php.net to get a copy of this message
foreach($_POST as $name=>$value) $$name = $value; On Wed, 3 Apr 2002, Matt Babineau wrote: > I have been playing with the $_POST variable > > how would I go about looping over the $_POST variable to retrieve the > variable and values? > > I can do this: > > <% > > if (count($_POST) > 0) { > /*send mail */%>send out mail<BR><% > $var1 = array_keys ($_POST); > $var2 = array_values ($_POST); > print_r ($var1);%><BR><% > print_r ($var2); > } > %> > > This gets me the list to variable names and the list of their values... > > How can I set local variable to those names and set the values to the > ones in the second list? > > > Matt Babineau > Web Developer > http://www.criticalcode.com > <http://www.criticalcode.com/> > Mobile: 603.943.4237 > matt@criticalcode.com > >

« previous php.windows (#12919) next »