$$foo or ${$foo} somethinbg like that ?
http://us2.php.net/manual/en/language.variables.variable.php
R'twick
- Original Message -
From: "Antti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 2:19 PM
Subject: [PHP] Naming a variable with a variable
> Ho can I
>Ho can I create (name) a variable with other variables value?
>
>If $foo = "bar";
>
>then the variable I want to create is $bar.
>
>How do I do this?
$$foo
see: http://www.php.net/manual/en/language.variables.variable.php
-
mic
On Tue, 17 Jun 2003, Antti wrote:
> Ho can I create (name) a variable with other variables value?
> If $foo = "bar";
> then the variable I want to create is $bar.
> How do I do this?
This prints "barvalue".
--
Mika Tuupola http://www.appelsiini.net/~tuupola/
--
Hi,
> Ho can I create (name) a variable with other variables value?
>
> If $foo = "bar";
>
> then the variable I want to create is $bar.
$$foo = "blah";
that will set $bar equal to blah.
-Dan Joseph
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: htt
4 matches
Mail list logo