This is the code snippet from my original message:
>
> // 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)
>
Well - what can i say?
Thank you all for helping me out!
The problem is pretty obvious (now that i know how to solve it) - It's a
typo/type combination.
I should use the line:
$var = "DAY" . $j; // $var is a string "DAYn"
As pointed out by Ruslan Ohitin.
Then i should correct the typo i have in my original code snippet (included
above):
$t->set_var( $var => $val ); should be $t->set_var( $var , $val );
Funny thou, i got no replies about this error. Didn't anyone see it?
The $t->set_var(array( $var => $val )); syntax is used when you have arrays
of variables.
I guess that this is a good pointer for that i shouldn't use cut'n'paste as
often as i do ;-)
Guess who looks like a fool?
Thanks again!
--
Michel Laine
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]