![]() Preserved Topic: PHP - eval() (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Seattle, WA, USA |
![]() 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 |
![]() 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 |
![]() |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() what max describes is kown as variable variables. just have a look into the manual over at www.php.net/manual |