Topic awaiting preservation: PHP - eval() (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Seattle, WA, USA |
posted 09-17-2002 07:08
ok, this is really bugging me. I'm not even sure if this is the right function I want to use. So basically what I want to due is have the value of one variable be the name of another. Sort of hard to explain but here's a simplified example: |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-17-2002 07:21
Mmmm. This is called "indirection" - turning data (a string) into code (a variable name). eval does it in Javascript, as well as the [] operators, so it would be logical if it did it in PHP also. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 09-17-2002 08:48 |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 09-17-2002 13:32
what max describes is kown as variable variables. just have a look into the manual over at www.php.net/manual |