Re: Need help with variables

From: Date: Tue, 26 Jun 2001 08:25:24 +0000
Subject: Re: Need help with variables
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-8035@lists.php.net to get a copy of this message
Ruslan Ohitin wrote: > Hello Michel, > > You mixing php variables and Template variables. They are from > different "namespaces". set_var() takes associative array with string > keys - Template var names. Edit one line of your code: > > ML> $var = ${"DAY".$j}; > $var = "DAY" . $j; // $var is a string "DAYn" > > -- > Best regards, > Ruslan Ohitin > mailto:rus@bagan.ru > I am afraid that this suggestion didn't help me. or am i missing something? With the example above i get the (string) value of variable $var to be "DAYn" - And not the variable name, which is what i want. In theory what i want to achieve is this: $DAY1="Monday"; $DAY2="Next day"; $DAY4="Some other day"; .... .... I have 54 Template variables named "DAYn". I want to (in a for loop - 'cause there are 54 of them!) transfer all string values from my $day[n] array to the Template variables namned "DAYn". The array $day[n] is then supposed to hold the required strings. $day[1]="Monday"; $day[2]="Next day"; $day[3]="Some other day"; ... ... -- Michel Laine

« previous php.windows (#8035) next »