Re: dynamically change a variable name

From: Date: Mon, 19 Mar 2001 13:51:15 +0000
Subject: Re: dynamically change a variable name
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-44542@lists.php.net to get a copy of this message
Thanks! "Mark Maggelet" <maggelet@mminternet.com> wrote in message news:200103190607.WAA08105@medusa.mminternet.com... On Sun, 18 Mar 2001 20:36:15 -0500, Gary (kcooke@mediaone.net) wrote: >Is there a way to dynamically change a variable name? For example: >I want to change the variable name $DWG to >$DWG1 >$DWG2 >$DWG3 >with a for loop. Is there a way to do this? you could try: for($i=1;$i<=3;$i++){ ${"DWG".$i}=$DWG; } or it might make more sense to use an array. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#44542) next »