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:[EMAIL PROTECTED]



ML> I am trying to assign a bunch of strings to some Template variables
ML> where:

ML> I have an array $day[n] where n is 0-34 and contain strings.
ML> I have Template variables named "DAYn", where n is a number 1-35.

ML> The template parsing is up and running, so i have left that part out.


ML>   // Do it!
ML>   for ($i = 0; $i <= 34; $i++) {

ML>     // Need help with this part
ML>     $j = $i + 1;
ML>     $var = ${"DAY".$j};
ML>     $val = $day[$i];

ML>     // Set PHPLIB Template variable
ML>     $t->set_var( $var => $val );

ML>   }

ML> // Do the rest (like parse templates)

ML> I have tried so many different combinations that i don't remember them
ML> all - The one above being the most recent.
ML> Not that it worked any better than any of the other ones...
ML> I have read Variable variables in the online manual.
ML> If that was on the right track - it must mean that i am just too stupid
ML> to get it right.

ML> Please help!
ML> --

ML> 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]

Reply via email to