Is there a way to take the value of a variable and turn it into another one?
Example: $line1 = "hp"; and make that into $hp?
| SitePoint Sponsor |
Is there a way to take the value of a variable and turn it into another one?
Example: $line1 = "hp"; and make that into $hp?
s c r i p t s f o r y o u . n e t
ScriptsForYou


It's called a variable variables
http://www.php.net/manual/en/languag...s.variable.phpPHP Code:$line1 = "hp";
$$line1 = "something";
echo $hp; //prints something
Ah thanks much =)
s c r i p t s f o r y o u . n e t
ScriptsForYou


Isn't that basically the same as pointers in Java/C etc..
Bookmarks