${$vNames[1]} = "new value";  // look at variable-variables in the manual
for more info

-----Original Message-----
From: Gaylen Fraley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 20, 2002 3:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable referencing/substitution


How can this be done?

If I have the name of a variable that is stored in an array, how do I use
the stored value to represent the actual variable?

Example:

$variable = "old value";
$vNames[1] = '$variable';  //literal $variable

I want to say $vNames[1] = "new value";  /and have $variable actually
change.

How?

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v3.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to