> -Original Message-
> From: Yoed [mailto:[EMAIL PROTECTED]]
> Sent: 10 January 2002 23:01
>
> 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_Sta
you'll be wanting "pointers"
eg
$Var_1_Stat = "hello world";
$Num = 1;
$var_name = "Var_${Num}_Stat"; // set up the actual var name
$Var_Call = $$var_name; // now reference the actual var
echo $Var_Call; // should by "hello world" ...
:)
-Original Message-
From:
Use:
$t = "Var_" . $Num_State;
$Var_Call= $$t;
or:
$Var_Call= ${"Var_" . $Num_State};
bvr.
On Thu, 10 Jan 2002 17:00:51 -0600, Yoed wrote:
>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.
>
>
3 matches
Mail list logo