i was wondering how to create variables on the fly,
by this i mean: i have a pair of strings or an associative array with one string for Key and another for Value:
Expand|Select|Wrap|Line Numbers
- $var1 = 'hello';
- $var2 = 'johnny';
Expand|Select|Wrap|Line Numbers
- array('hello'=>'johnny');
how could i manage to make of these two strings, a vairable with one becoming the name of the variable and the other the value.
Expand|Select|Wrap|Line Numbers
- echo $hello; //prints johnny
is there a thing like:
Expand|Select|Wrap|Line Numbers
- ${$var1} = $var2;
Thankyou.