RE: [PHP] composed variables

From: Date: Tue, 20 May 2003 09:12:07 +0000
Subject: RE: [PHP] composed variables
Groups: php.general 
Request: Send a blank email to php-general+get-148271@lists.php.net to get a copy of this message
> -----Original Message----- > From: Michael Timinger [mailto:me@timinger.net] > Sent: 19 May 2003 22:08 > To: php-general@lists.php.net > Subject: Re: [PHP] composed variables > > > hello Jay! > The idea behind is to have an universal script, which can > handle different > forms, which have a different amount of variables to post, based on a > database. I get back the amount of fields needed (same amount as the > database fields). Because I do not know the amount of > variables out of the > form I want to perform that while ... which gives back > $var1=$_POST["val1"]; to $varx ... > Better description? > Thanx for your help! > Mike > "Jay Blanchard" <jay.blanchard@niicommunications.com> schrieb > im Newsbeitrag > news:C8F323573C030A448F3E5A2B6FE2070B02A142@nemesis... > [snip] > I am trying to create a composed variable: > I get from a form the amount of variables back, eg. 4 > I need now a way to perform something like > while ($i >= $anzVar) { > ... > which creates variables: $var1, $var2 and so on. > [/snip] Would a simple foreach($_POST as $key=>$val) not be sufficient for your needs? Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#148271) next »