you can create variables dinamically like that $counter=0; foreach ($some_arr as $key=>$value){ $("your_dyn_var".$counter}="some html code"; $counter++; }
So if you have 5 iterations you will have in the namespace new 5 variables : from $your_dyn_var0 to $your_dyn_var4 When you want to show them in the parsed html do: $counter=0; while(isset(${"your_dyn_var".$counter++})) echo ${"your_dyn_var".($counter-1);} or for ($tmp_count=0;$tmp_count<$counter;$counter++){ echo ${"your_dyn_var".$counter"};} Best regards Andrey Hristov ----- Original Message ----- From: Honey House Designs To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:56 PM Subject: [PHP-DEV] Newbie help w/ dynamic variables I would like to dynamically create variables in my WHILE loop that then can actually have php parsed html code stored inside them and then have the value of that variable run when after php is run and as the html is evaluated at page loading... Any suggestions? And be gentle... I am a newbie! Tx, tb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php