Re: A variable with a variable
| From: | George Nicolae | Date: | Thu, 10 Jan 2002 23:31:10 +0000 |
| Subject: | Re: A variable with a variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80112@lists.php.net to get a copy of this message | ||
$v="Var_".$Nums."_Stat";
$Var_Call=$$v;
--
Best regards,
George Nicolae
IT Manager
___________________
X-Playin - Professional Web Design
www.x-playin.f2s.com
"Yoed" <yoed@zarcrom.com> wrote in message
news:20020110230130.12049.qmail@pb1.pair.com...
> I never really found the trick to this one yet, and wanted to see what you
> guys say is the best methods to call a variable that needs a variable.
>
> Say I have variables called $Var_1_Stat, $Var_2_Stat, and $Var_3_Stat
> and I have a variable called $Nums thats value is either 1, 2, or 3.
> How then would I go about calling $Var_Call=$Var_$Num_Stat ? Or
> $Var_Call="$Var_$Num_State".... hmm not hat wouldn't work?
> So what do you guys suggest?
>
> No if statements... since I want to know a way that can be used if I have
> more then just 3 or a limited ammount of varaibles.
>
> Thank you for your time,
> Yoed
>
>