Re: composed variables

From: Date: Mon, 19 May 2003 20:46:12 +0000
Subject: Re: composed variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148204@lists.php.net to get a copy of this message
Hi, something like this does the trick: $i = 0; $anzVar = 5; while($i++ <= $anzVar) { $varname = "var$i"; $$varname = "whatever u want"; } this would create the following variables: $var0, $var1, ..., $var4 happy coding, Catalin "Michael Timinger" <me@timinger.net> wrote in message news:20030519201917.13055.qmail@pb1.pair.com... > Hello 2 all! > 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. > comprendre? > Thanx in advance! > > -- > Mit herzlichen Grüßen > Michael Timinger > > --------------------------------------- > consult@nt > An der Kaiserburg 21 > 40629 Düsseldorf > --------------------------------------- > fon: +49 700 TIMINGER (84646437) > fax: +49 12126 WILDDUCK (94533825) > mail: me@timinger.net > --------------------------------------- > "Whatever you can do or dream you can, begin it. > Boldness has genius, power and magic in it." > --------------------------------------- > >

« previous php.general (#148204) next »