Need help with variables
| From: | Michel Laine | Date: | Mon, 25 Jun 2001 12:49:59 +0000 |
| Subject: | Need help with variables | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-8019@lists.php.net to get a copy of this message | ||
I am trying to assign a bunch of strings to some Template variables
where:
I have an array $day[n] where n is 0-34 and contain strings.
I have Template variables named "DAYn", where n is a number 1-35.
The template parsing is up and running, so i have left that part out.
// Do it!
for ($i = 0; $i <= 34; $i++) {
// Need help with this part
$j = $i + 1;
$var = ${"DAY".$j};
$val = $day[$i];
// Set PHPLIB Template variable
$t->set_var( $var => $val );
}
// Do the rest (like parse templates)
I have tried so many different combinations that i don't remember them
all - The one above being the most recent.
Not that it worked any better than any of the other ones...
I have read Variable variables in the online manual.
If that was on the right track - it must mean that i am just too stupid
to get it right.
Please help!
--
Michel Laine